{"id":15633262,"url":"https://github.com/egoist/vue-prism-component","last_synced_at":"2025-04-04T23:09:19.339Z","repository":{"id":45275009,"uuid":"95902065","full_name":"egoist/vue-prism-component","owner":"egoist","description":"highlight code using prism.js and vue component","archived":false,"fork":false,"pushed_at":"2023-08-12T20:13:38.000Z","size":312,"stargazers_count":157,"open_issues_count":25,"forks_count":23,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T22:13:12.020Z","etag":null,"topics":["component","highlight","prism","prismjs","vue"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/egoist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"egoist"}},"created_at":"2017-06-30T15:37:07.000Z","updated_at":"2024-09-23T23:05:52.000Z","dependencies_parsed_at":"2024-06-18T13:37:33.726Z","dependency_job_id":null,"html_url":"https://github.com/egoist/vue-prism-component","commit_stats":{"total_commits":25,"total_committers":5,"mean_commits":5.0,"dds":"0.16000000000000003","last_synced_commit":"ac4941f69a44522f37fcc83d0e8b2079be6ed87c"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fvue-prism-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fvue-prism-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fvue-prism-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fvue-prism-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egoist","download_url":"https://codeload.github.com/egoist/vue-prism-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247043341,"owners_count":20874086,"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":["component","highlight","prism","prismjs","vue"],"created_at":"2024-10-03T10:47:52.472Z","updated_at":"2025-04-04T23:09:19.321Z","avatar_url":"https://github.com/egoist.png","language":"JavaScript","funding_links":["https://github.com/sponsors/egoist"],"categories":[],"sub_categories":[],"readme":"# vue-prism-component\n\n[![NPM version](https://img.shields.io/npm/v/vue-prism-component.svg?style=flat)](https://npmjs.com/package/vue-prism-component) [![NPM downloads](https://img.shields.io/npm/dm/vue-prism-component.svg?style=flat)](https://npmjs.com/package/vue-prism-component) [![Release Package](https://github.com/egoist/vue-prism-component/workflows/Release%20Package/badge.svg)](https://github.com/egoist/vue-prism-component/actions?query=workflow%3A%22Release+Package%22)  [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000\u0026style=flat)](https://github.com/sponsors/egoist)\n\n## Install\n\n```bash\nyarn add vue-prism-component\n```\n\nCDN: [UNPKG](https://unpkg.com/vue-prism-component/dist/) | [jsDelivr](https://cdn.jsdelivr.net/npm/vue-prism-component/dist/)\n\n## Usage\n\nFirst you need to load `Prism` somewhere in your app:\n\n```js\n// yarn add prismjs\nimport 'prismjs'\nimport 'prismjs/themes/prism.css'\n```\n\nOR:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"https://unpkg.com/prismjs/themes/prism.css\" /\u003e\n\u003cscript src=\"https://unpkg.com/prismjs\"\u003e\u003c/script\u003e\n```\n\nThen In SFC:\n\n```vue\n\u003ctemplate\u003e\n  \u003cprism language=\"javascript\"\u003e{{ code }}\u003c/prism\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport Prism from 'vue-prism-component'\n\nexport default {\n  data() {\n    return {\n      code: 'const a = b'\n    }\n  },\n  components: {\n    Prism\n  }\n}\n\u003c/script\u003e\n```\n\nOr In JSX:\n\n```js\n\u003cPrism language=\"html\"\u003e{`\n  \u003cdiv\u003e\n    \u003cstrong\u003efoo\u003c/strong\u003e\n  \u003c/div\u003e\n`}\u003c/Prism\u003e\n```\n\nFor inline rendering, pass the `inline` prop:\n\n```js\n\u003cPrism inline language=\"javascript\" \u003ealert(\"foo\");\u003c/Prism\u003e\n```\n\nYou can also set the code using a prop:\n\n```js\nimport 'prismjs/components/prism-rust'\n\n\u003cPrism language=\"rust\" code={ myRustCode } /\u003e\n```\n\n## Related\n\n- [vue-highlight-component](https://github.com/egoist/vue-highlight-component): highlight code using highlight.js and vue component.\n\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n\n## Author\n\n**vue-prism-component** © [egoist](https://github.com/egoist), Released under the [MIT](./LICENSE) License.\u003cbr\u003e\nAuthored and maintained by egoist with help from contributors ([list](https://github.com/egoist/vue-prism-component/contributors)).\n\n\u003e [egoistian.com](https://egoistian.com) · GitHub [@egoist](https://github.com/egoist) · Twitter [@rem_rin_rin](https://twitter.com/rem_rin_rin)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fvue-prism-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegoist%2Fvue-prism-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fvue-prism-component/lists"}