{"_rev":"2-85fa3c48f2df29bf847a6dbc5a2cde1e","time":{"created":"2022-12-07T15:57:14.863Z","2.3.0":"2022-12-07T15:12:34.134Z","modified":"2022-12-07T15:57:15.257Z","2.3.1":"2022-12-07T15:57:15.138Z"},"_id":"@careyq/markdown-it-prism","name":"@careyq/markdown-it-prism","dist-tags":{"latest":"2.3.1"},"versions":{"2.3.1":{"name":"@careyq/markdown-it-prism","version":"2.3.1","description":"Highlights code blocks in markdown-it using Prism.","keywords":["markdown-it","markdown-it-plugin","highlight","prism","prismjs"],"homepage":"https://github.com/jGleitz/markdown-it-prism","license":"MIT","author":{"name":"careyq","url":"https://joshuagleitze.de"},"main":"build/index.js","types":"build/index.d.ts","engines":{"node":">=6.0.0"},"repository":{"type":"git","url":"git+https://github.com/jGleitz/markdown-it-prism.git"},"scripts":{"build:transpile":"babel ./src --out-dir build --extensions '.ts'","build:types":"tsc -p src","lint":"npm-run-all lint:*","lint:types":"tsc","lint:style":"eslint .","prepack":"npm-run-all build:*","unittest":"jest","test":"npm-run-all lint:* unittest"},"dependencies":{"prismjs":"1.29.0"},"devDependencies":{"@babel/cli":"7.19.3","@babel/core":"7.20.5","@babel/preset-env":"7.20.2","@babel/preset-typescript":"7.18.6","@babel/register":"7.18.9","@semantic-release/changelog":"6.0.2","@semantic-release/git":"10.0.1","@types/jest":"29.2.4","@types/markdown-it":"12.2.3","@types/prismjs":"1.26.0","@typescript-eslint/eslint-plugin":"5.45.1","@typescript-eslint/parser":"5.45.1","babel-plugin-add-module-exports":"1.0.4","eslint":"8.29.0","jest":"29.3.1","markdown-it":"13.0.1","markdown-it-attrs":"4.1.4","npm-run-all":"4.1.5","semantic-release":"19.0.5","typescript":"4.9.3"},"gitHead":"a229827b20d02f62ba0e84220bb2ff4c576b33d8","bugs":{"url":"https://github.com/jGleitz/markdown-it-prism/issues"},"_id":"@careyq/markdown-it-prism@2.3.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-YWsbfKscprCtadTxATtnXzeqPsOFg8lHww67aUzvEPBjH1tvSf9bgfp5w2dEDDZQiPGI6ShQwRy0BAjq2QepmQ==","shasum":"74bbd77e51658ba70d8a44529dcc443cc0564703","tarball":"https://registry.npmjs.org/@careyq/markdown-it-prism/-/markdown-it-prism-2.3.1.tgz","fileCount":5,"unpackedSize":17491,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSAgbkX5EGYNhIkIusOr76RHzdu+A3MUDKeQ3FJd85AwIhAKgYTuaabd2y55tJLyKo51qkH70RpO5+P2BZFKQJEapU"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkLfbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQ1Q/+OlLtDJ1vxH8JICwMW59XzBwnpiGfAUY4Tnxs7PX3d9TI7Szu\r\n5x7xYmpfD43YpWlgQk+h3VK8t20sz/H4nfBYu4FvhThkZOCwHyxxwiYhN9YH\r\nDnw2fWTTz0+wcxJOd4PSrogHjBnc9abR95Lh3XR3gkAv1hBlD1hgSAHZ3XMT\r\n0zPB2nxvUW4OrfZ/aeZ2HIzz9mICxq+ZiCk3abd7Y/iag9pX59NRzLMbq5tF\r\npft5OOHbrcJ27el2dblIKPLPKzAeC7tBThQafkPlSMpI+8p8yFiY2x1d/rqO\r\nauHXLI6JtXEEJOxzOiOGmq2femwkRleJwCl4rwvEleP1yEy6xe8GX4xowmi/\r\nk+saw+1Z0rMSkKL/oLSaoqnWoJSwnoe+ofPMsh0HGtBKllwUb6BIu99XHCM/\r\nLWyBxqpPrQ/PwXT8fEPJMugTmDDfJLquKB8KQq033hMtyPQb8ODIH7t1D8j6\r\n3o/96U0W8xJTfdF+bSlnul2Q+/GqAgicVYG7SYuwB1H4c7xf5j4e4oNGB4fU\r\nkvrk4Wm+yiuwVQGCz/CpCALwqYj3488Ehw/CUhb3m+QcRDxyQY1oeE9LnIxq\r\nmiVoVGJuj4ANO/dVChjYmoDsRL4fGx9bnaSrQ1mv0xibZFFqVB6WH+DGDcLu\r\n1ihl5l8+39EHTneZ7UBR/QyMyG9dMEm091g=\r\n=o0kb\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"careyq","email":"careyq03@gmail.com"},"directories":{},"maintainers":[{"name":"careyq","email":"careyq03@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/markdown-it-prism_2.3.1_1670428634979_0.1330663756367052"},"_hasShrinkwrap":false}},"maintainers":[{"name":"careyq","email":"careyq03@gmail.com"}],"description":"Highlights code blocks in markdown-it using Prism.","homepage":"https://github.com/jGleitz/markdown-it-prism","keywords":["markdown-it","markdown-it-plugin","highlight","prism","prismjs"],"repository":{"type":"git","url":"git+https://github.com/jGleitz/markdown-it-prism.git"},"author":{"name":"careyq","url":"https://joshuagleitze.de"},"bugs":{"url":"https://github.com/jGleitz/markdown-it-prism/issues"},"license":"MIT","readme":"# markdown-it-prism [![Build Status](https://travis-ci.org/jGleitz/markdown-it-prism.svg?branch=master)](https://travis-ci.org/jGleitz/markdown-it-prism) [![npm version](https://badge.fury.io/js/markdown-it-prism.svg)](https://badge.fury.io/js/markdown-it-prism) [![Bower version](https://badge.fury.io/bo/markdown-it-prism.svg)](https://badge.fury.io/bo/markdown-it-prism)\r\n\r\n> [markdown-it](https://github.com/markdown-it/markdown-it) plugin to highlight code blocks using [Prism](http://prismjs.com/)\r\n\r\n## Usage\r\n\r\n```js\r\nconst md = require('markdown-it')();\r\nconst prism = require('markdown-it-prism');\r\n\r\nmd.use(prism, options);\r\n```\r\n\r\nThe plugin will insert the necessary markup into all code blocks. [Include one of Prism’s stylesheets](http://prismjs.com/#basic-usage) in\r\nyour HTML to get highlighted code.\r\n\r\n### Options\r\n\r\nThe `options` object may contain:\r\n\r\n| Name                            | Description                                                                                                                                                                                                                                                                                                                                                       | Default     |\r\n|---------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|\r\n| `highlightInlineCode`           | Whether to highlight inline code.                                                                                                                                                                                                                                                                                                                                 | `false`     |\r\n| `plugins`                       | Array of [Prism Plugins](http://prismjs.com/#plugins) to load. The names to use can be found [here](https://github.com/PrismJS/prism/tree/master/plugins). Please note that some prism plugins (notably line-numbers) rely on the DOM being present and can thus not be used with this package (see [#1](https://github.com/jGleitz/markdown-it-prism/issues/1)). | `[]`        |\r\n| `init`                          | A function called after setting up prism. Will receive the prism instance as only argument. Useful for plugins needing further intialisation.                                                                                                                                                                                                                     | `() => {}`  |\r\n| `defaultLanguageForUnknown`     | The language to use for code blocks that specify a language that Prism does not know. No default will be used if this option is `undefined`.                                                                                                                                                                                                                      | `undefined` |\r\n| `defaultLanguageForUnspecified` | The language to use for code block that do not specify a language. No default will be used if this option is `undefined`.                                                                                                                                                                                                                                         | `undefined` |\r\n| `defaultLanguage`               | Shorthand to set both `defaultLanguageForUnknown` and `defaultLanguageForUnspecified` to the same value.                                                                                                                                                                                                                                                          | `undefined` |\r\n\r\n### Inline Code\r\n\r\nWhen `highlightInlineCode` is set, inline code will be highlighted just like fenced code blocks are.\r\nTo specifiy the language of inline code, add `{language=<your-language>}` after the code segment:\r\n\r\n```markdown\r\n`class Demo { };`{language=cpp}\r\n```\r\n\r\nThis syntax is compatible with [markdown-it-attrs](https://github.com/arve0/markdown-it-attrs):\r\nThe `language=<x>` part will be stripped, but everything else between `{` and `}` will work\r\nwith [markdown-it-attrs](https://github.com/arve0/markdown-it-attrs) as usual.\r\n\r\n## Usage with Webpack\r\n\r\nIf you want to use this plugin together with [Webpack](https://webpack.js.org/), you need to import all languages you intend to use:\r\n\r\n```javascript\r\nimport MarkdownIt from 'markdown-it';\r\nimport prism from 'markdown-it-prism';\r\n\r\nimport \"prismjs/components/prism-clike\"\r\nimport \"prismjs/components/prism-java\"\r\n\r\nfunction component() {\r\n\tconst md = new MarkdownIt();\r\n\tmd.use(prism);\r\n\tconst element = document.createElement('div');\r\n\telement.innerHTML = md.render(`\r\nHere is some *code*:\r\n\\`\\`\\`java\r\npublic class Test {\r\n  public void foo() {}\r\n}\r\n\\`\\`\\`\r\n`);\r\n\r\n\treturn element;\r\n}\r\n\r\ndocument.body.appendChild(component());\r\n```\r\n\r\n*Beware*: Prisms languages have dependencies onto each other. You need to import the languages together with their dependencies in the\r\ncorrect order.\r\n","readmeFilename":"README.md"}