JSPM

asciidoctor-shiki

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q25503F
  • License MIT

asciidoctor.js plugin for syntax highlight with shiki

Package Exports

  • asciidoctor-shiki
  • asciidoctor-shiki/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (asciidoctor-shiki) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Asciidoctor Syntax Highlight Extension for Node.js

Installation

This extension is available on npmjs.com

$ node install asciidoctor-shiki

Usage

This extension is not designed for browser. You must not use this extension without Node.js.

const asciidoctor = require('@asciidoctor/core')()
const AsciidoctorShiki = require('asciidoctor-shiki')
asciidoctor.SyntaxHighlighter.register('shiki', AsciidoctorShiki)
const options = {
  attributes: {
    'source-highlighter': 'shiki',
    'shiki-theme': 'nord'
  }
}
const document = `
[source,ruby]
----
p "Hello"
----
`;
console.log(asciidoctor.convert(document, options))
  1. Register this extension using SyntaxHighlighter.register
  2. Set the attribute source-highlighter
  3. Set the attribute shiki-theme

Copyright (c) 2022 TANIGUCHI Masaya. All rights reserved.

This extension is licensed under the MIT license https://git.io/mit-license