markdown渲染插件
hexo-renderer-kramed
This plugin uses kramed but not marked as render engine, it is a fork of hexo-renderer-marked. You need to uninstall hexo-renderer-marked to avoid conflicts.
Why use kramed?
Just for the support of mathjax. I’ve modified the inline math format, like this example below:
1 | `$\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:
1 | <script type="text/x-mathjax-config"> |
Tips
You can use the following formats for your equations:
1 | inlineMath: `$\sigma$` |
If you need to contain $
in \ tag:
1 | ` $some code$ ` |
If you need to contain $$$$ in your text:
1 | \$\$ |
Installation
1 | $ npm uninstall hexo-renderer-marked --save |
- Hexo 3: >= 0.2
- Hexo 2: 0.1.x
Options
You can configure this plugin in _config.yml
.
1 | kramed: |
- 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.
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 XXX17的个人博客!