docpad-archive / docpad-plugin-robotskirt

Markdown rendering for DocPad, using Robotskirt (Sundown)
Other
6 stars 0 forks source link
docpad-plugin unsupported

Robotskirt Plugin for DocPad

Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
Gratipay donate button Flattr donate button PayPal donate button BitCoin donate button Wishlist browse button

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

Robotskirt is no longer supported.

Install

docpad install 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: 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

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:
        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

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:
        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

History

Discover the change history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

Gratipay donate button Flattr donate button PayPal donate button BitCoin donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Become a contributor!

License

Licensed under the incredibly permissive MIT license

Copyright © 2012+ Bevry Pty Ltd us@bevry.me (http://bevry.me)