Currently I use asciidoctor.js as shown below. How can I integrate asciidoctor-web-pdf in that worklfow to also produce pdf output and open the pdf file? I tried as denoted by the comments but it did not work.
// Run this file using npm from main directory: "npm run doc"
// Documentation of asciidoctor.js:
// https://docs.asciidoctor.org/asciidoctor.js/latest/setup/quick-tour/
const asciidoctor = require('asciidoctor')(); // eslint-disable-line import/no-extraneous-dependencies
//const asciidoctorPdf = require('asciidoctor-web-pdf')(); // eslint-disable-line import/no-extraneous-dependencies
const open = require('open'); // eslint-disable-line import/no-extraneous-dependencies
// create html output
asciidoctor.convertFile('doc/index.adoc', { safe: 'safe', to_dir: './public', mkdirs: true });
//create pdf output
//asciidoctorPdf.convertFile('doc/index.adoc', { safe: 'safe', to_dir: './public', mkdirs: true });
// open html output in default browser
open('./public/index.html');
Currently I use asciidoctor.js as shown below. How can I integrate asciidoctor-web-pdf in that worklfow to also produce pdf output and open the pdf file? I tried as denoted by the comments but it did not work.
Related:
https://github.com/asciidoctor/asciidoctor.js/issues/1703