NOTE! Robotskirt has become deprecated and replaced by hoedown. Please use one of DocPad's other markdown renderer plugins.
Markdown rendering for DocPad, using Robotskirt
Convention: .html.md|markdown
docpad install robotskirt
For information on customising your plugin configuration you can refer to the DocPad FAQ
You can customise the Robotskirt options using the robotskirtOptions
object. By default we use:
plugins:
robotskirt:
robotskirtOptions:
EXT_AUTOLINK: true
EXT_FENCED_CODE: true
EXT_LAX_SPACING: true
EXT_NO_INTRA_EMPHASIS: true
EXT_SPACE_HEADERS: true
EXT_STRIKETHROUGH: true
EXT_SUPERSCRIPT: true
EXT_TABLES: true
HTML_SKIP_HTML: false
HTML_SKIP_STYLE: false
HTML_SKIP_IMAGES: false
HTML_SKIP_LINKS: false
HTML_EXPAND_TABS: false
HTML_SAFELINK: false
HTML_TOC: false
HTML_HARD_WRAP: false
HTML_USE_XHTML: true
HTML_ESCAPE: false
It makes "smart" punctuation. See more on its homepage. Default is true:
plugins:
robotskirt:
smartypants: true
It supports highlighting code blocks at build time. Following is using highlight.js.
plugins:
robotskirt:
highlight: (code, lang)->
has = lang && hl.LANGUAGES.hasOwnProperty(lang.trim())
open = if has then '<pre><code class="lang-'+lang.trim()+'">' else '<pre><code>'
body = if has then hl.highlight(lang, code).value else hl.highlightAuto(code).value
close = '</code></pre>'
return open + body + close
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:
inline: (src, hash)->
out = src
#for people
out = out.replace /(^|[ \t]+)@([a-zA-Z0-9]+)/g, (whole, m1, m2) ->
hash m1 + '<a href="https://twitter.com/' + m2 + '">@' + m2 + '</a>'
#for hash tag·
out = out.replace /(^|[ \t]+)#([ㄱ-ㅎ가-힣a-zA-Z0-9]+)/g, (whole, m1, m2) ->
hash m1 + '<a href="https://twitter.com/search?q=%23' + escapeURL(m2) + '&src=hash">#' + m2 + '</a>'
return out
Discover the change history by heading on over to the HISTORY.md
file.
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
These amazing people are maintaining this project:
No sponsors yet! Will you be the first?
These amazing people have contributed code to this project:
Licensed under the incredibly permissive MIT license
Copyright © 2012+ Bevry Pty Ltd us@bevry.me (http://bevry.me)