Plugin to import Asciidoctor files using Rollup.
Quickstart
$ yarn add rollup-plugin-asciidoc --dev
Add the plugin to Rollup configuration.
rollup.config.js
import asciidoc from 'rollup-plugin-asciidoc'
// ...
plugins: [
asciidoc(),
]
-
Import Asciidoc plugin
-
Plugins section in Rollup configuration
Import an Asciidoc file in your source code.
example.js
import post from 'post.adoc'
console.log(post)
-
Import Asciidoc file.
-
Log the content.
It will output something like:
{
meta: {
title: "Post title",
date: "2019-11-11"
},
html: "<p>Such a post!</p>"
}