How to use asciidoctor-web-pdf with node.js script?
stefaneidelloth opened this issue · 1 comments
stefaneidelloth commented
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');
Related:
ggrossetie commented
Please direct usage question to the project chat at chat.asciidoctor.org. You can find more information about the support policy on the following page in the docs: docs.asciidoctor.org/about/support.