0.0.2 • Published 3 years ago

snowpack-plugin-asciidoctor v0.0.2

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

Quick start

yarn add snowpack-plugin-asciidoctor --dev

Update your snowpack config:

// ./snowpack.config.json
{
  "plugins": [
    ["snowpack-plugin-asciidoctor", { /* see "Plugin Options" below */ }],
  ]
}
// ./test.adoc

= My Asciidoctor File

:myVar: 'a value for my variable'
// ./your-file.js

import { doc } from './test.adoc'

console.log('Doc', doc)

// Prints (output)
{
  filePath: '/home/your/test.adoc'
  html: '<h1>My Asciidoctor File</h1>'
  metadata: {
    //  asciidoctor document attributes https://asciidoctor.org/docs/user-manual/#attribute-catalog
    // it contains also any attribute you declared in the asciidoctor file, e.g:
    myVar: 'a value for my variable'
  }
}

Plugin Options

Plugin options are passed directly to the Asciidoctor.js compiler. You can find the full attribute catalog at https://asciidoctor.org/docs/user-manual/#attribute-catalog.

Acknowledgements

LICENSE

MIT