@ink-feather-org/asciidoctor-shiki
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Asciidoctor Syntax Highlight Extension for Node.js

Installation

This extension is available on npmjs.com

$ node install @ink-feather-org/asciidoctor-shiki

Usage

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

import adoc from '@asciidoctor/core'
import { AsciidoctorShiki } from '@ink-feather-org/asciidoctor-shiki'

const asciidoctor = adoc()
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 and License

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

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

Package Sidebar

Install

npm i @ink-feather-org/asciidoctor-shiki

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

65.5 kB

Total Files

15

Last publish

Collaborators

  • raldone01