Mit Hugo selber habe ich noch nicht gearbeitet. Für meinen Workflow nutze ich markdown-pdf, einen Wrapper für Phantomjs, Running.js und remarkable, zum Erstellen des PDF-Dokuments. Vielleicht hilft es jamanden weiter:
Code:
var markdownpdf = require('markdown-pdf');
var fs = require('fs');
var pdfPath = './docs/Dokumentation.pdf';
var srcPath = './docs/src';
var srcFiles = [];
var options = {
runningsPath: '.running.js',
cssPath: './docs/css/pdf.css',
highlightCssPath: './docs/css/hightlight.css',
remarkable: {
html: true,
breaks: false,
linkify: false
}
};
fs.readdir(srcPath, function (err, files) {
console.log('Read files from ' + srcPath);
files.forEach(function (file) {
console.log(' - ' + file);
srcFiles.push(srcPath + '/' + file);
});
markdownpdf(options).concat.from(srcFiles).to(pdfPath, function () {
console.log('Created pdf file ', pdfPath)
});
});
Lesezeichen