Closed JoseMCO closed 6 years ago
Thanks and good idea, but I could not find the code related to author
informations on ba4c55b8c2b95c198b6476daaf631296a7a72e73
author is just an example, it could be anything and the idea is that you can pass variables to use in the header or footer, e.g.:
// file.md
<!--
MTP = {
"author": "José Castro",
"project": "Documentation"
}
-->
...
and on the custom header
// header.js
module.exports = function (info) {
var project = (info.fileParams && info.fileParams.project) ? "Project" : info.fileParams.project;
var author = (info.fileParams && info.fileParams.author) ? "Anon" : info.fileParams.author;
return {
height: '1cm',
contents: '<div id="page-header" style="text-align: right;">'+project+' written by '+author+'</div>'
};
};
will print "Documentation written by José Castro" on the header of the pdf
Fixed in #44 by save dialog
Grabs a definition of MTP (as Json) in the file comments (if there's one) and save it as fileParams in the jobInfo variable.
Also if there's an "outputDir" definition on MTP, uses that as the new path for the generated pdf. (this last option was added as a quick solution for issue #44)
For example:
will expose author and outputDir via info.fileParams to use on the custom header or footer and the generated pdf will be saved as out.pdf in the pdf folder.