Code Monkey home page Code Monkey logo

plugin-highlightjs's Introduction

plugin-highlightjs

主题端的代码块高亮插件,集成了 highlight.js

开发环境

git clone [email protected]:halo-sigs/plugin-highlightjs.git

# 或者当你 fork 之后

git clone [email protected]:{your_github_id}/plugin-highlightjs.git
cd path/to/plugin-highlightjs
# macOS / Linux
./gradlew build

# Windows
./gradlew.bat build

修改 Halo 配置文件:

halo:
  plugin:
    runtime-mode: development
    classes-directories:
      - "build/classes"
      - "build/resources"
    lib-directories:
      - "libs"
    fixedPluginPath:
      - "/path/to/plugin-highlightjs"

使用方式

  1. Releases 下载最新的 JAR 文件。
  2. 在 Halo 后台的插件管理上传 JAR 文件进行安装。

需要注意的是,首次安装之后,需要进入插件设置页面保存一次设置,才能正常使用。

主题适配

此插件无需主题主动适配即可使用,其原理就是将 highlight.js 所需的依赖引入和初始化代码都自动插入到了内容页面上。因此,主题开发者无需再针对代码高亮进行适配开发,如果有特殊的需求,建议共同完善此插件。

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.