Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hexo-prismjs-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-prismjs-plugin

Hexo code highlight by Prism.js

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

NPM

Hexo Prism.js 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-prismjs-plugin

Usage

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

prism_plugin:
  mode: 'preprocess'    # realtime or preprocess
  theme: 'default'
  line_number: false    # default false
  auto_import_assets: true   # default true

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)
  • auto_import_assets

    • true (insert automaticaly css and js files)
    • false (let you choose another prism.js theme file or you own)

If you want avoid AMP validation errors, disable auto import asseets

And then, clean and generate project by running command:

hexo clean
hexo generate

Supported languages

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

FAQs

Package last updated on 23 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc