Skip to content

nickhoo555/hexo-prism-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NPM

Hexo-Prism-Plugin

Since highlight.js didn't support JSX syntax properly, I wrote this plugin to replace Hexo's default code highlight plugin.

Install

npm i -S hexo-prism-plugin

Usage

First, you should edit your _config.yml by adding following configuration.

prism_plugin:
  mode: 'preprocess'    # realtime/preprocess
  theme: 'default'
  line_number: false    # default false

Note: check _config.yml highlight option. Make sure that

highlight:
  enable: false
  • mode:

    • realtime (Parse code on browser in real time)
    • preprocess (Preprocess code in node)
  • theme:

    • default
    • coy
    • dark
    • funky
    • okaidia
    • solarizedlight
    • tomorrow
    • twilight
  • line_number:

    • true (Show line numbers)
    • false (Default, Hide line numbers)

And then, clean and generate project by running command:

hexo clean
hexo g

Supported languages

You could find the supported languages here: http://prismjs.com/#languages-list

License

MIT

About

Hexo plugin for code highlighting by prism.js, supporting JSX syntax.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%