All Projects → hexojs → Hexo Renderer Markdown It

hexojs / Hexo Renderer Markdown It

Licence: mit
Markdown-it is a Markdown parser, done right. A faster and CommonMark compliant alternative for Hexo.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Hexo Renderer Markdown It

Vanilla Back To Top
Simple and smooth Back To Top button
Stars: ✭ 179 (-19.73%)
Mutual labels:  hexo
Hexo Prism Plugin
Hexo plugin for code highlighting by prism.js, supporting JSX syntax
Stars: ✭ 195 (-12.56%)
Mutual labels:  hexo
Hexo Abbrlink
create one and only link for every post for hexo
Stars: ✭ 212 (-4.93%)
Mutual labels:  hexo
Post Scheduler
Schedule posts & content updates for static websites (Jekyll, Hugo, Gatsby, Phenomic etc)
Stars: ✭ 184 (-17.49%)
Mutual labels:  hexo
Hexo Theme Geektutu
极速加载的Hexo主题,不引入第三方JS库
Stars: ✭ 187 (-16.14%)
Mutual labels:  hexo
Hexo Theme Ochuunn
A simple green super hexo theme.
Stars: ✭ 202 (-9.42%)
Mutual labels:  hexo
Hexo Theme Nayo
一个简洁的Hexo主题.
Stars: ✭ 172 (-22.87%)
Mutual labels:  hexo
Hexo Theme Cafe
精简的Hexo博客主题,样式风格如阮一峰老师博客
Stars: ✭ 215 (-3.59%)
Mutual labels:  hexo
Hexo Theme Miho
🍺一款单栏响应式的hexo主题, A single column response for hexo . https://blog.minhow.com
Stars: ✭ 194 (-13%)
Mutual labels:  hexo
Hexo Theme Jsimple
Simple three columns theme for Hexo.Inspired by JianShu.com
Stars: ✭ 210 (-5.83%)
Mutual labels:  hexo
Hexo Theme Butterfly
🦋 A Hexo Theme: Butterfly
Stars: ✭ 3,146 (+1310.76%)
Mutual labels:  hexo
Hexo Theme Pln
📝 Plain theme for Hexo.
Stars: ✭ 186 (-16.59%)
Mutual labels:  hexo
Hexo Theme Hipaper
A fashional newspaper theme for Hexo.
Stars: ✭ 204 (-8.52%)
Mutual labels:  hexo
Hexo Theme Random
A hexo theme with random fullscreen background image.
Stars: ✭ 179 (-19.73%)
Mutual labels:  hexo
Hexo Theme Nlvi
🎨A simple theme for hexo.
Stars: ✭ 213 (-4.48%)
Mutual labels:  hexo
Hexo Theme Clover
Clover theme for Hexo.
Stars: ✭ 172 (-22.87%)
Mutual labels:  hexo
Twikoo
一个简洁、安全、免费的静态网站评论系统 | A simple, safe, free comment system.
Stars: ✭ 195 (-12.56%)
Mutual labels:  hexo
Hexo All Minifier
A plugin for Hexo that optimizes HTML, CSS, JS and imagages, and it can optionally deploys your blog.
Stars: ✭ 224 (+0.45%)
Mutual labels:  hexo
Hexo Editor
An editor for hexo blog.
Stars: ✭ 213 (-4.48%)
Mutual labels:  hexo
Hexo Theme Hiero
An awesome magazine, blog theme for your Hexo site.
Stars: ✭ 209 (-6.28%)
Mutual labels:  hexo

hexo-renderer-markdown-it

Build Status npm version npm dependencies Coverage Status

This renderer plugin uses Markdown-it as a render engine on Hexo. Adds support for Markdown and CommonMark.

Main Features

  • Support for Markdown, GFM and CommonMark
  • Extensive configuration
  • Faster than the default renderer | hexo-renderer-marked
  • Safe ID for headings
  • Anchors for headings with ID
  • Footnotes
  • <sub> H2O
  • <sup> x2
  • <ins> Inserted

Installation

Follow the installation guide.

Options

markdown:
  preset: 'default'
  render:
    html: true
    xhtmlOut: false
    langPrefix: 'language-'
    breaks: true
    linkify: true
    typographer: true
    quotes: '“”‘’'
  enable_rules:
  disable_rules:
  plugins:
  anchors:
    level: 2
    collisionSuffix: ''
    permalink: false
    permalinkClass: 'header-anchor'
    permalinkSide: 'left'
    permalinkSymbol: '¶'
    case: 0
    separator: '-'

Refer to the wiki for more details.

Extensibility

This plugin overrides some default behaviors of how markdown-it plugin renders the markdown into html, to integrate with the Hexo ecosystem. It is possible to override this plugin too, without resorting to forking the whole thing.

For example, to enable unsafe links (which is disabled by default):

hexo.extend.filter.register('markdown-it:renderer', function(md) {
  const { config } = this; // Optional, parse user config from _config.yml
  md.validateLink = function() { return true; };
});

// Specify custom function in plugin option
const { slugize } = require('hexo-util');
const opts = hexo.config.markdown.anchors;
const mdSlugize = (str) => {
  return slugize(str, { transform: opts.case, ...opts });
};

hexo.extend.filter.register('markdown-it:renderer', function(md) {
  md.use(require('markdown-it-table-of-contents'), {
    includeLevel: [2,3,4],
    slugify: mdSlugize
  });
});

Save the file in "scripts/" folder and run Hexo as usual.

Refer to markdown-it API documentation.

Requests and bug reports

If you have any feature requests or bugs to report, you're welcome to file an issue.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].