Giter VIP home page Giter VIP logo

transcordia / hexo-renderer-markdown-it-plus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chenxchen/hexo-renderer-markdown-it-plus

0.0 3.0 0.0 15 KB

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

Home Page: https://chchc.me/hexo-article/2017/07/27/hexo-renderer-markdown-it-plus-plugin-demo/

License: MIT License

JavaScript 100.00%

hexo-renderer-markdown-it-plus's Introduction

hexo-renderer-markdown-it-plus

This renderer plugin uses Markdown-it as a render engine on Hexo.

This renderer plugin is forked from hexo-renderer-markdown-it. Add some plugins and support third-part markdown-it plugin.

This is demo project.

Main Features

Install

npm un hexo-renderer-marked --save
npm i hexo-renderer-markdown-it-plus --save

Options

Configuring the renderer is a fairly simple task because all the settings are in the main hexo _config.yml file. You just need to open it in your favourite text editor and write down your configuration.

markdown_it_plus:
    highlight: true
    html: true
    xhtmlOut: true
    breaks: true
    langPrefix:
    linkify: true
    typographer:
    quotes: “”‘’
    pre_class: highlight

Katex

Katex plugin is enabled by default. However, this renderer alone does not work out of the box for mathematical formulas to display correctly on your website. Therefore, you do not need to do anything if you do not want to use Katex. Otherwise, if you want to use katex, you must add this css style to your website: https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/katex.min.css

Advanced Options

The markdown-it plugins listed above is enabled by default. If you want to disable any plugin, see the configuration example below:

markdown_it_plus:
    highlight: true
    html: true
    xhtmlOut: true
    breaks: true
    langPrefix:
    linkify: true
    typographer:
    quotes: “”‘’
    plugins:
        - plugin:
            name: markdown-it-mark
            enable: false

plugins enabled by default:

  • markdown-it-emoji
  • markdown-it-sub
  • markdown-it-sup
  • markdown-it-deflist
  • markdown-it-abbr
  • markdown-it-footnote
  • markdown-it-ins
  • markdown-it-mark
  • @iktakahiro/markdown-it-katex
  • markdown-it-toc-and-anchor

Add other markdown-it Plugins

If you want to add a plugin named as markdown-it-something:

1.Install this plugin

npm install markdown-it-something --save

2.config main hexo _config.yml

markdown_it_plus:
    # ...
    plugins:
        - plugin:
            name: markdown-it-something
            enable: true
            options:
                # this is plugin option

LOG

  • 1.0.1 Add pre_class option.
  • 1.0.2 Add highlight.js pakage to dependencies#2.
  • 1.0.3 Update katex plugin, using katex 0.9
  • 1.0.4 PR #17

hexo-renderer-markdown-it-plus's People

Contributors

chenxchen avatar opportunityliu avatar

Watchers

Jim Cook avatar James Cloos avatar Thomas Acree avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.