JSPM

hexo-renderer-kramed-essence

1.0.4
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • 0
    • Score
      100M100P100Q15424F
    • License GPL-3.0-or-later

    Markdown renderer plugin for Hexo with kramed-essence engine

    Package Exports

    • hexo-renderer-kramed-essence

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hexo-renderer-kramed-essence) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    hexo-renderer-kramed-essence

    GitHub license npm

    This plugin uses kramed-essence but not marked nor kramed as render engine, it is a fork of hexo-renderer-kramed. You need to uninstall hexo-renderer-marked or hexo-renderer-kramed to avoid conflicts.

    Why use kramed-essence?

    For better the support of mathjax. I've modified the inline math format, like this example below:

    `$\sigma$`

    But this renderer will only wrap your inline tex and display tex with a <script> tag, to fully enable mathjax, you need to add some js code in your theme, what I did in my theme hexo-theme-paperbox is:

    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        menuSettings: {
          zoom: "None"
        },
        showMathMenu: false,
        jax: ["input/TeX","output/CommonHTML"],
        extensions: ["tex2jax.js"],
        TeX: {
          extensions: ["AMSmath.js","AMSsymbols.js"],
          equationNumbers: {
            autoNumber: "AMS"
          }
        },
        tex2jax: {
          inlineMath: [["\\(", "\\)"]],
          displayMath: [["\\[", "\\]"]]
        }
      });
    </script>
    
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.6.1/MathJax.js"></script>

    Tips

    You can use the following formats for your equations:

    inlineMath: `$\sigma$`
    
    displayMath: $$\sigma$$

    If you need to contain $ in <code> tag:

    ` $some code$ `

    If you need to contain $$ in your text:

    \$\$

    Installation

    $ npm uninstall hexo-renderer-marked --save
    $ npm install hexo-renderer-kramed-essence --save

    Options

    You can configure this plugin in _config.yml.

    kramed:
      gfm: true
      pedantic: false
      sanitize: false
      tables: true
      breaks: true
      smartLists: true
      smartypants: true
    • gfm - Enables GitHub flavored markdown
    • pedantic - Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
    • sanitize - Sanitize the output. Ignore any HTML that has been input.
    • tables - Enable GFM tables. This option requires the gfm option to be true.
    • breaks - Enable GFM line breaks. This option requires the gfm option to be true.
    • smartLists - Use smarter list behavior than the original markdown.
    • smartypants - Use "smart" typograhic punctuation for things like quotes and dashes.