rollup-plugin-asciidoc v1.0.4
= Rollup Plugin for Asciidoc Carlos Martin Sanchez https://github.com/carlosvin[@carlosvin] :idprefix: :idseparator: - :uri-nodejs: https://nodejs.org :uri-opal: https://opalrb.com :uri-repo: https://github.com/carlosvin/rollup-plugin-asciidoc/ :uri-freesoftware: https://www.gnu.org/philosophy/free-sw.html ifndef::uri-rel-file-base:uri-rel-file-base: link: :license: {uri-repo}/blob/master/LICENSE :endash:
Plugin to import Asciidoctor files using Rollup.
== Quickstart
$ yarn add rollup-plugin-asciidoc --dev
Add the plugin to Rollup configuration.
.rollup.config.js
source,javascript
import asciidoc from 'rollup-plugin-asciidoc' // <1>
// ...
plugins: [ // <2> asciidoc(),
]
<1> Import Asciidoc plugin <2> Plugins section in Rollup configuration
Import an Asciidoc file in your source code.
.example.js
source,javascript
import post from 'post.adoc' // <1>
console.log(post);
<1> Import Asciidoc file. <2> Log the content.
It will output something like:
source,javascript
{ meta: { title: "Post title", date: "2019-11-11" }, html: "Such a post!"
}
== Changelog
=== 0.3.0 add:: Add tabindex=0 to hightlighted source code, to prevent https://dequeuniversity.com/rules/axe/3.5/scrollable-region-focusable[scrollable-region-focusable] accessibility issue. update:: Bump dependencies.
=== 0.2.0
add:: Apply code highlighting thanks to https://github.com/jirutka/asciidoctor-highlight.js/[asciidoctor-highlight.js]. From generated site, you will have to https://highlightjs.org/download/[import the hihglight.js CSS file from CDN].