The asciidoctor-template.js
is a template backend for Asciidoctor.js based on Jade template engine.
Here’s the list of currently supported backends:
In this example we are using the Reveal.js backend:
npm install asciidoctor.js
npm install asciidoctor-template.js
npm install asciidoctor-reveal.js
var asciidoctor = require('asciidoctor.js')();
require('asciidoctor-template.js')();
const options = {safe: 'safe', backend: 'revealjs'};
const content = `= Title\n\n\
== Slide 1\n\n\
Content 1\n\n\
== Slide 2\n\n\
Content 2`;
const result = asciidoctor.convert(content, options);
console.log(result);