{"id":13508638,"url":"https://github.com/metachris/vue-highlightjs","last_synced_at":"2025-03-30T11:32:24.823Z","repository":{"id":38361901,"uuid":"80740927","full_name":"metachris/vue-highlightjs","owner":"metachris","description":"Syntax highlighting with highlight.js for Vue.js 2.x","archived":true,"fork":false,"pushed_at":"2021-05-24T15:54:38.000Z","size":18,"stargazers_count":336,"open_issues_count":0,"forks_count":41,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-02T17:03:36.927Z","etag":null,"topics":["highlighting","highlightjs","javascript","vuejs","vuejs2"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metachris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-02T15:55:18.000Z","updated_at":"2024-12-11T15:42:54.000Z","dependencies_parsed_at":"2022-07-16T05:16:39.943Z","dependency_job_id":null,"html_url":"https://github.com/metachris/vue-highlightjs","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metachris%2Fvue-highlightjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metachris%2Fvue-highlightjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metachris%2Fvue-highlightjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metachris%2Fvue-highlightjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metachris","download_url":"https://codeload.github.com/metachris/vue-highlightjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242646209,"owners_count":20162850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["highlighting","highlightjs","javascript","vuejs","vuejs2"],"created_at":"2024-08-01T02:00:56.040Z","updated_at":"2025-03-30T11:32:24.370Z","avatar_url":"https://github.com/metachris.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","UI组件","Components \u0026 Libraries","UI Components","UI Components [🔝](#readme)"],"sub_categories":["杂","UI Components","Miscellaneous"],"readme":"# vue-highlightjs\n\n**This project is superseded by the official Highlight.js Vue plugin:**\n\n* https://github.com/highlightjs/vue-plugin\n* https://www.npmjs.com/package/@highlightjs/vue-plugin\n\n---\n\n[Vue.js](https://vuejs.org/) syntax highlighting made easy, using [highlight.js](https://highlightjs.org/).\n\n[![Build Status](https://travis-ci.org/metachris/vue-highlightjs.svg?branch=master)](https://travis-ci.org/metachris/vue-highlightjs)\n\n## Quickstart\n\n### Installation\n\nSimply install the [npm package `vue-highlightjs`](https://www.npmjs.com/package/vue-highlightjs):\n\n    npm install --save vue-highlightjs\n\n### Using vue-highlightjs\n\nIn your main JavaScript file (eg. `main.js`):\n\n```javascript\n// Import Vue and vue-highlgihtjs\nimport Vue from 'vue'\nimport VueHighlightJS from 'vue-highlightjs'\nimport 'highlight.js/styles/default.css' // or other highlight.js theme\n\n// Tell Vue.js to use vue-highlightjs\nVue.use(VueHighlightJS)\n```\n\nIn your template, in order to highlight javascript code:\n\n```html\n\u003c!-- If your source-code lives in a variable called 'sourcecode' --\u003e\n\u003cpre v-highlightjs=\"sourcecode\"\u003e\u003ccode class=\"javascript\"\u003e\u003c/code\u003e\u003c/pre\u003e\n\n\u003c!-- If you want to highlight hardcoded source-code --\u003e\n\u003cpre v-highlightjs\u003e\u003ccode class=\"javascript\"\u003econst s = new Date().toString()\u003c/code\u003e\u003c/pre\u003e\n```\n---\n\n* You can see a live example here: https://www.python-boilerplate.com/\n* Fiddle with it: https://jsfiddle.net/metachris/1vz9oobc/\n* See also this blog post for more information: https://www.metachris.com/2017/02/vuejs-syntax-highlighting-with-highlightjs/\n\n\n## Contributing\n\nAny sort of contributions and feedback is much appreciated. Just\nleave an issue or pull-request!\n\nThis project uses the [AirBnB code style](https://github.com/airbnb/javascript).\n\nPlease run `npm run lint` and `npm run test` before you submit a pull request! \u003c3\n\n\n## About\n\nAuthor: Chris Hager \u003cchris@linuxuser.at\u003e (https://www.metachris.com)\n\nLicense: MIT\n\nContributors:\n\n* [Chris Hager](https://www.metachris.com)\n* [mr-krille](https://github.com/mr-krille)\n* [Duoc Nguyen](https://github.com/nguyenvanduocit)\n* [Shu Ding](https://github.com/shudin)\n\n\n## Changelog\n\nv1.3.3\n\n* Documentation\n\nv1.3.1\n\n* Changed `const` to `var` for compatibility with PhantomJS and UglifyJS\n* [Bugfix](https://github.com/metachris/vue-highlightjs/pull/6) to allow empty content\n\nv1.2.2\n\n* Fixed displaying and highlighting HTML tags passed as value to the directive (thanks @nguyenvanduocit)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetachris%2Fvue-highlightjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetachris%2Fvue-highlightjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetachris%2Fvue-highlightjs/lists"}