Robotskirt Plugin for DocPad
Markdown rendering for DocPad, using Robotskirt
Convention: .html.md|markdown
Install
npm install --save docpad-plugin-robotskirt
Configure
For information on customising your plugin configuration you can refer to the DocPad FAQ
Robotskirt Options
You can customise the Robotskirt options using the robotskirtOptions
object. By default we use:
plugins:robotskirt:robotskirtOptions:EXT_AUTOLINK: trueEXT_FENCED_CODE: trueEXT_LAX_SPACING: trueEXT_NO_INTRA_EMPHASIS: trueEXT_SPACE_HEADERS: trueEXT_STRIKETHROUGH: trueEXT_SUPERSCRIPT: trueEXT_TABLES: trueHTML_SKIP_HTML: falseHTML_SKIP_STYLE: falseHTML_SKIP_IMAGES: falseHTML_SKIP_LINKS: falseHTML_EXPAND_TABS: falseHTML_SAFELINK: falseHTML_TOC: falseHTML_HARD_WRAP: falseHTML_USE_XHTML: trueHTML_ESCAPE: false
SmartyPants
It makes "smart" punctuation. See more on its homepage. Default is true:
plugins:robotskirt:smartypants: true
Hightlight
It supports highlighting code blocks at build time. Following is using highlight.js.
plugins:robotskirt::has = lang && hlLANGUAGEShasOwnPropertylangtrimopen = if has then '<pre><code class="lang-'+langtrim+'">' else '<pre><code>'body = if has then hlhighlightlangcodevalue else hlhighlightAutocodevalueclose = '</code></pre>'return open + body + close
Inline
You can add your markup in only normal text blocks. Next example is Twitter tag exmaple. @pismute
will be rendered <a href="https://twitter.com/pismute">@pismute</a>
:
plugins:robotskirt::out = src#for peopleout = outreplace /@/ghash m1 + '<a href="https://twitter.com/' + m2 + '">@' + m2 + '</a>'#for hash tag·out = outreplace /#/ghash m1 + '<a href="https://twitter.com/search?q=%23' + escapeURLm2 + '&src=hash">#' + m2 + '</a>'return out
History
You can discover the history inside the History.md
file
License
Licensed under the incredibly permissive MIT License
Copyright © 2012 Bevry Pty Ltd