makdoc-robotskirt

Robotskirt plugin for makdoc

npm install makdoc-robotskirt
4 downloads in the last month

makdoc-robotskirt

robotskirt buff for makdoc

Getting Started

Install the module with: npm install makdoc-robotskirt

add package to package.json

{
  "devDependencies": {
    "makdoc-robotskirt": "latest"
  }
}

Now, Makdoc will load this buff and render \*.html.md and \*.html.markdown files to html.

Options

The following options can be specified in the Gruntfile.js.

smartypants

  • type : boolean
  • description : It makes "smart" punctuation. See more on its homepage. Default is true.
  makdoc:
    options:
      robotskirt:
        smartypants: true

highlight

  • type : function
  • description : It supports highlighting code blocks at build time. Following is using highlight.js.
  makdoc:
    options:
      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

  • type : function
  • description : You can add your markup in only normal text blocks. Next example is Twitter tag exmaple. @pismute will be rendered @pismute
  makdoc:
    options:
      robotskirt:
        highlight: (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

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

License

Copyright (c) 2013+ Makdoc Licensed under the MIT license.

npm loves you