https://github.com/tani/asciidoctor-shiki
https://github.com/tani/asciidoctor-shiki
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tani/asciidoctor-shiki
- Owner: tani
- Created: 2022-02-03T13:19:59.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:33:26.000Z (over 1 year ago)
- Last Synced: 2024-10-30T05:05:16.680Z (8 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Asciidoctor.js Syntax Highlight Extension with Shiki
## Installation
This extension is available on https://jsr.io/@tani/asciidoctor-shiki
## Usage
This extension is not designed for browser. You must not use this extension
without Node.js.```js
import asciidoctor from '@asciidoctor/core';
improt AsciidoctorShiki from '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 and License
Copyright (c) 2024 TANIGUCHI Masaya. All rights reserved.
This extension is licensed under the MIT license https://git.io/mit-license