{"name":"marked-extras","description":"Extras for marked.js. Utils, language definitions, templates for custom headings and sensible defaults.","version":"0.2.4","homepage":"https://github.com/jonschlinkert/marked-extras","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/marked-extras.git"},"bugs":{"url":"https://github.com/jonschlinkert/marked-extras/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/marked-extras/blob/master/LICENSE-MIT"}],"main":"index.js","dependencies":{"highlight.js":"~8.0.0","lodash":"~2.4.1","marked":"0.3.0","underscore.string":"~2.3.3"},"keywords":["convert markdown","gfm markdown","gfm","github markdown","handlebars helper","handlebars","helper","highlight.js","markdown headings","markdown to html","markdown","marked","md"],"_id":"marked-extras@0.2.4","dist":{"shasum":"6eb011db02b5d855445010c86e8d8cdb14b71ce8","tarball":"http://registry-npm.ywwl.com/marked-extras/download/marked-extras-0.2.4.tgz","integrity":"sha512-wWsRM//mYJczPri7J4QdTvDQkArFmAwefjYEVSniOjwMnUnqIrYpPxu3vPZzr7ms7wLV7NdsXQwOlepcjz9HjA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXOigBxo8QDXBYCmQSSFFQeUayXf4lTCaadkV7q/eJgwIgV3Lg4fNN1FuwK4TsEVHiaKL0yDM9TQzh7aeagLX5AHs="}],"size":6585,"noattachment":false,"key":"/marked-extras/-/marked-extras-0.2.4.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"readme":"# marked-extras [![NPM version](https://badge.fury.io/js/marked-extras.png)](http://badge.fury.io/js/marked-extras)\r\n\r\n> Extras, utils, language definitions and defaults for marked.js\r\n\r\nIf you find a bug or have a feature request, [please create an issue](https://github.com/helpers/marked-extras/issues).\r\n\r\n## Installation\r\nUse [npm](npmjs.org) to install the package\r\n\r\n```\r\nnpm i marked-extras --save\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nvar marked = require('marked');\r\nvar extras = require('marked-extras');\r\n\r\n// Example node module\r\nmodule.exports = function (str, options) {\r\n  options = options || {};\r\n\r\n  // Initialize marked extras\r\n  extras.init(options);\r\n\r\n  // Set marked.js options\r\n  marked.setOptions(extras.markedDefaults);\r\n\r\n  // do stuff...\r\n  // ...\r\n\r\n  // Convert markdown to HTML\r\n  return marked(str);\r\n};\r\n```\r\n\r\n### Highlighting\r\n\r\nAlso be sure to add the [highlight.js](http://highlightjs.org/usage/) scripts to your HTML:\r\n\r\n```html\r\n<script src=\"js/highlight.js\"></script>\r\n<!-- or, a customized version -->\r\n<script src=\"js/highlight.pack.js\"></script>\r\n\r\n<script>hljs.initHighlightingOnLoad();</script>\r\n```\r\n\r\n## Options\r\n\r\nThe following example shows the actual defaults used in this lib, and how they can be customized:\r\n\r\n```js\r\nvar opts = {\r\n  renderer: renderer,\r\n  gfm: true,\r\n  tables: true,\r\n  breaks: false,\r\n  pedantic: false,\r\n  sanitize: false,\r\n  smartLists: true,\r\n  smartypants: false,\r\n\r\n  // highlight.js options\r\n  prefix: 'lang-',\r\n  tabReplace: ' ',\r\n  highlight: function (code, lang) {\r\n    console.log(languages[lang]);\r\n    try {\r\n      if (languages[lang]) {\r\n        lang = languages[lang];\r\n      } else {\r\n        return code;\r\n      }\r\n      return hljs.highlight(lang, code).value;\r\n    } catch(e) {\r\n      return hljs.highlightAuto(code).value;\r\n    }\r\n  }\r\n};\r\n\r\nvar markedOpts = _.extend(extras.markedDefaults, opts);\r\n\r\n// Define marked.js options\r\nmarked.setOptions(markedOpts);\r\n```\r\n\r\n## Contributing\r\nIn lieu of a formal styleguide, take care to maintain the existing coding style.\r\n\r\n## Authors\r\n\r\n**Jon Schlinkert**\r\n\r\n+ [github/jonschlinkert](https://github.com/jonschlinkert)\r\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\r\n\r\n**Brian Woodward**\r\n\r\n+ [github/doowb](https://github.com/doowb)\r\n+ [twitter/doowb](http://twitter.com/jonschlinkert)\r\n\r\n\r\n## License\r\nCopyright (c) 2014 Jon Schlinkert, Brian Woodward, contributors.\r\nReleased under the MIT license","publish_time":1398264913772,"_cnpm_publish_time":1398264913772,"dist-tags":{"latest":"0.2.4"}}