{"_id":"@clarle/metalsmith-prism","_rev":"5-a86fac67ec9b7b8a9707958ad1b63385","name":"@clarle/metalsmith-prism","description":"Syntax highlighting for Metalsmith HTML templates using Prism.js (with line numbers)","dist-tags":{"latest":"2.2.0"},"versions":{"2.2.0-alpha-1":{"name":"@clarle/metalsmith-prism","version":"2.2.0-alpha-1","description":"Syntax highlighting for Metalsmith HTML templates using Prism.js (with line numbers)","main":"lib/index.js","scripts":{"preversion":"npm test","test":"mocha ./tests/index.js","lint":"eslint ./lib ./tests"},"repository":{"type":"git","url":"git+https://github.com/clarle/metalsmith-prism.git"},"keywords":["metalsmith","prismjs","syntax","highlighting"],"author":{"name":"Robert McGuinness","email":"rob.mcguinness@availity.com"},"contributors":[{"name":"Clarence Leung","email":"hello@clarle.com"}],"license":"MIT","bugs":{"url":"https://github.com/Availity/metalsmith-prism/issues"},"homepage":"https://github.com/Availity/metalsmith-prism","dependencies":{"cheerio":"0.20.0","he":"^0.5.0","lodash":"4.6.1","metalsmith":"^1.7.0","prismjs":"1.4.1"},"devDependencies":{"chai":"3.5.0","eslint":"1.6.0","eslint-config-availity":"1.0.1","mocha":"2.4.5"},"gitHead":"95b678ac2e9e7c8ba2d80442c04f30bc5e9af13f","_id":"@clarle/metalsmith-prism@2.2.0-alpha-1","_shasum":"dd5ca0103600e7b80344de340cbd1fe1269aedf4","_from":".","_npmVersion":"2.14.18","_nodeVersion":"4.2.1","_npmUser":{"name":"clarle","email":"cleung0@gmail.com"},"dist":{"shasum":"dd5ca0103600e7b80344de340cbd1fe1269aedf4","tarball":"https://registry.npmjs.org/@clarle/metalsmith-prism/-/metalsmith-prism-2.2.0-alpha-1.tgz","integrity":"sha512-nkpAGxsnHt9JNUi4ZRa2nIrVh3s6YldHQvElsa1h5ieU9QLCplGkXj+oZNtvgy0QrTpk88DbofbqgBdAH80xTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH4m2gXmp+5yzsWQZgLLX+8hYMopDHIJf67mCcYhxtvuAiB3sReT2qvY7neBHHcZimP/w+Ai1wCUpeXUJhDgNF0ZrQ=="}]},"maintainers":[{"name":"clarle","email":"cleung0@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/metalsmith-prism-2.2.0-alpha-1.tgz_1460327998471_0.33525677025318146"}},"2.2.0-alpha-2":{"name":"@clarle/metalsmith-prism","version":"2.2.0-alpha-2","description":"Syntax highlighting for Metalsmith HTML templates using Prism.js (with line numbers)","main":"lib/index.js","scripts":{"preversion":"npm test","test":"mocha ./tests/index.js","lint":"eslint ./lib ./tests"},"repository":{"type":"git","url":"git+https://github.com/clarle/metalsmith-prism.git"},"keywords":["metalsmith","prismjs","syntax","highlighting"],"author":{"name":"Robert McGuinness","email":"rob.mcguinness@availity.com"},"contributors":[{"name":"Clarence Leung","email":"hello@clarle.com"}],"license":"MIT","bugs":{"url":"https://github.com/Availity/metalsmith-prism/issues"},"homepage":"https://github.com/Availity/metalsmith-prism","dependencies":{"cheerio":"0.20.0","he":"^0.5.0","lodash":"4.6.1","metalsmith":"^1.7.0","prismjs":"1.4.1"},"devDependencies":{"chai":"3.5.0","eslint":"1.6.0","eslint-config-availity":"1.0.1","mocha":"2.4.5"},"gitHead":"f8739fd6177b2c237c864e47bacf5c41f7e47b69","_id":"@clarle/metalsmith-prism@2.2.0-alpha-2","_shasum":"5ca72039e13c1e56967498c269b15fdac42e5371","_from":".","_npmVersion":"2.14.18","_nodeVersion":"4.2.1","_npmUser":{"name":"clarle","email":"cleung0@gmail.com"},"dist":{"shasum":"5ca72039e13c1e56967498c269b15fdac42e5371","tarball":"https://registry.npmjs.org/@clarle/metalsmith-prism/-/metalsmith-prism-2.2.0-alpha-2.tgz","integrity":"sha512-UziVK8Cbam2rrN4uMyPXR2ZlkrrADAYsgZDojU2EAkerVCsKU2JkbpMq+/f/F1u923Al+HNO4XQ/yXdbMRSPbA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCU+WGHq0E8AKWxbhAZsXYC9Ho/X+t1vlkco/uxKpH+1gIgECyiAoZEpDgSerXsoTXWtwexIXk8XER71GzkcXJUqt4="}]},"maintainers":[{"name":"clarle","email":"cleung0@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/metalsmith-prism-2.2.0-alpha-2.tgz_1460328978978_0.363169722026214"}},"2.2.0":{"name":"@clarle/metalsmith-prism","version":"2.2.0","description":"Syntax highlighting for Metalsmith HTML templates using Prism.js (with line numbers)","main":"lib/index.js","scripts":{"preversion":"npm test","test":"mocha ./tests/index.js","lint":"eslint ./lib ./tests"},"repository":{"type":"git","url":"git+https://github.com/clarle/metalsmith-prism.git"},"keywords":["metalsmith","prismjs","syntax","highlighting"],"author":{"name":"Robert McGuinness","email":"rob.mcguinness@availity.com"},"contributors":[{"name":"Clarence Leung","email":"hello@clarle.com"}],"license":"MIT","bugs":{"url":"https://github.com/Availity/metalsmith-prism/issues"},"homepage":"https://github.com/Availity/metalsmith-prism","dependencies":{"cheerio":"0.20.0","he":"^0.5.0","lodash":"4.6.1","metalsmith":"^1.7.0","prismjs":"1.4.1"},"devDependencies":{"chai":"3.5.0","eslint":"1.6.0","eslint-config-availity":"1.0.1","mocha":"2.4.5"},"gitHead":"0bb9f84fa6239a8efbb8133f8e95b36289b84ba2","_id":"@clarle/metalsmith-prism@2.2.0","_shasum":"0f3f39ad1874d178cc3dc89c112641ba7ada4007","_from":".","_npmVersion":"2.14.18","_nodeVersion":"4.2.1","_npmUser":{"name":"clarle","email":"cleung0@gmail.com"},"dist":{"shasum":"0f3f39ad1874d178cc3dc89c112641ba7ada4007","tarball":"https://registry.npmjs.org/@clarle/metalsmith-prism/-/metalsmith-prism-2.2.0.tgz","integrity":"sha512-osb5zcEgIoqQPwB22bam22bkazOgCvmHWNzsN4xeUvZoNigkMIiOv9xZ+XtdDGWoa0kJGKPWTk3JCCu3a95JTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFV7vWmoDpgIBNQKBFgvW4gDt/EN9xOhDoSaZiutWmH9AiEAk1Q1BNnae7sfiRUylOrRWrvI1Uu5hL0RhIQHGzV0f9I="}]},"maintainers":[{"name":"clarle","email":"cleung0@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/metalsmith-prism-2.2.0.tgz_1460329261904_0.6707089000847191"}}},"readme":"# metalsmith-prism\n\n> Syntax highlighting for [Metalsmith](http://www.metalsmith.io/) HTML templates using [Prism.js](http://prismjs.com/)\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&label=license)](http://opensource.org/licenses/MIT)\n[![NPM](http://img.shields.io/npm/v/metalsmith-prism.svg?style=flat-square&label=npm)](https://npmjs.org/package/metalsmith-prism)\n[![Dependency Status](https://img.shields.io/david/Availity/metalsmith-prism.svg?style=flat-square)](https://david-dm.org/Availity/metalsmith-prism)\n[![Linux Passing](https://img.shields.io/travis/Availity/metalsmith-prism.svg?style=flat-square&label=linux)](https://travis-ci.org/Availity/metalsmith-prism)\n[![Windows Passing](https://img.shields.io/appveyor/ci/robmcguinness/metalsmith-prism.svg?style=flat-square&label=windows)](https://ci.appveyor.com/project/robmcguinness/metalsmith-prism)\n\nThe main difference between this package and [Availity/metalsmith-prism](https://github.com/Availity/metalsmith-prism) is the support for line numbers, without any browser-side JavaScript. It's a bit of a hack, so use at your own risk.\n\n## Quickstart\n\n+ Install **metalsmith-prism**\n\n>\n```bash\n  npm install @clarle/metalsmith-prism --save-dev\n```\n\n+ Add language definition to code block\n\n>\n```html\n<code class=\"language-css\">p { color: red }</code>\n```\n\n+ Add `metalsmith-prism` plugin to metalsmith\n\n>\n```js\nvar metalsmith = require('metalsmith');\nvar metalsmithPrism = require('@clarle/metalsmith-prism');\nmetalsmith(__dirname)\n  .use(metalsmithPrism())\n  .build();\n```\n\n+ **_OPTIONAL_** To use with Markdown code blocks rendered by [metalsmith-markdown](https://github.com/segmentio/metalsmith-markdown)\n\n>\n```js\nvar metalsmith = require('metalsmith');\nvar markdown = require('metalsmith-markdown');\nvar metalsmithPrism = require('@clarle/metalsmith-prism');\nmetalsmith(__dirname)\n  // Custom langPrefix option needed as markdown uses 'lang-' by default:\n  .use(markdown( { langPrefix: 'language-' } ))\n  .use(metalsmithPrism())\n  .build();\n```\n\n## Language support\n\nSupports all programming languages that have a corresponding Prism.js component file. Component files are found in the [Prism.js `components` directory](https://github.com/PrismJS/prism/tree/master/components). \n\n### JSON \n\nJSON syntax highlighting is enhanced using the following syntax definition\n\n>\n```javascript\nPrism.languages.json = {\n  'keys': /\".+\"(?=:)/g,\n  'boolean': /\\b(true|false)/g,\n  'punctuation': /({|}|:|\\[|\\]|,)/g,\n  'keyword': /\\b(null)\\b/g\n}\n```\n>\n```html\n<code class=\"language-json\">\n{\n    ping: \"pong\"\n}\n</code>\n```\n\n### Options\n\n#### decode (optional)\n\n- Always decode the html entities when processing language of type `markup`\n\n```javascript\nMetalsmith(__dirname)\n  .use(metalsmithPrism({\n    decode: true\n  }))\n```\n\n#### json (optional)\n\n- Supply custom JSON syntax definition\n\n```javascript\nMetalsmith(__dirname)\n  .use(metalsmithPrism({\n    json: {\n      'keys': /\".+\"(?=:)/g,\n      'boolean': /\\b(true|false)/g,\n      'punctuation': /({|}|:|\\[|\\]|,)/g,\n      'keyword': /\\b(null)\\b/g\n    }\n  }))\n```\n\n#### lineNumbers (optional)\n\n- Appends class `line-numbers` to parent `<pre>` tag if present\n\n```javascript\nMetalsmith(__dirname)\n  .use(metalsmithPrism({\n    lineNumbers: true\n  }))\n```\n\n\n\n## Authors\n\n**Robert McGuinness**\n+ [rob.mcguinness@availity.com](rob.mcguinness@availity.com)\n\n## Disclaimer\n\nOpen source software components distributed or made available in the Availity Materials are licensed to Company under the terms of the applicable open source license agreements, which may be found in text files included in the Availity Materials.\n\n## Copyright and license\n\nCode and documentation copyright 2016 Availity, LLC. Code released under [the MIT license](https://github.com/Availity/metalsmith-prism/blob/master/LICENSE).\n\n\n\n","maintainers":[{"name":"clarle","email":"cleung0@gmail.com"}],"time":{"modified":"2022-06-12T16:04:20.719Z","created":"2016-04-10T22:39:58.922Z","2.2.0-alpha-1":"2016-04-10T22:39:58.922Z","2.2.0-alpha-2":"2016-04-10T22:56:21.413Z","2.2.0":"2016-04-10T23:01:02.330Z"},"homepage":"https://github.com/Availity/metalsmith-prism","keywords":["metalsmith","prismjs","syntax","highlighting"],"repository":{"type":"git","url":"git+https://github.com/clarle/metalsmith-prism.git"},"contributors":[{"name":"Clarence Leung","email":"hello@clarle.com"}],"author":{"name":"Robert McGuinness","email":"rob.mcguinness@availity.com"},"bugs":{"url":"https://github.com/Availity/metalsmith-prism/issues"},"license":"MIT","readmeFilename":"README.md"}