From ae7bcb4277d6ce225516bcf36ef07451fe2be2ee Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sun, 25 Oct 2020 16:22:54 -0600 Subject: increase pandoc fanciness --- etc/md.yml | 14 ++--- etc/pdf.yml | 18 +++---- etc/process-md.lua | 7 +++ etc/process-pdf.lua | 0 etc/template.html | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 175 insertions(+), 17 deletions(-) create mode 100644 etc/process-md.lua create mode 100644 etc/process-pdf.lua create mode 100644 etc/template.html (limited to 'etc') diff --git a/etc/md.yml b/etc/md.yml index aece004..a918de3 100644 --- a/etc/md.yml +++ b/etc/md.yml @@ -1,23 +1,23 @@ from: markdown to: html5 +template: etc/template.html standalone: true -verbosity: INFO +filters: + - etc/process-md.lua -top-level-division: chapter +metadata: + lang: "en" -pdf-engine: weasyprint +verbosity: INFO table-of-contents: false number-sections: true shift-heading-level-by: 1 -title-prefix: "Crowbar Specification: " +title-prefix: "Crowbar Specification" eol: lf # syntax-definition: fail-if-warnings: true -dump-args: false -ignore-args: false -trace: false diff --git a/etc/pdf.yml b/etc/pdf.yml index 5ef3857..a76afca 100644 --- a/etc/pdf.yml +++ b/etc/pdf.yml @@ -1,20 +1,18 @@ from: html to: pdf -standalone: true +template: etc/template.html -metadata: - title: "Crowbar Specification" +filters: + - etc/process-pdf.lua -verbosity: INFO +metadata: + title-before-toc: true + title: "Crowbar Specification" -top-level-division: chapter +verbosity: WARNING pdf-engine: weasyprint table-of-contents: true - -fail-if-warnings: true -dump-args: false -ignore-args: false -trace: false +number-sections: false diff --git a/etc/process-md.lua b/etc/process-md.lua new file mode 100644 index 0000000..30c85de --- /dev/null +++ b/etc/process-md.lua @@ -0,0 +1,7 @@ +function Pandoc(doc) + local title_header = pandoc.Header(1, '') + local title = doc.meta.title + title_header.content = title + doc.blocks:insert(1, title_header) + return doc +end diff --git a/etc/process-pdf.lua b/etc/process-pdf.lua new file mode 100644 index 0000000..e69de29 diff --git a/etc/template.html b/etc/template.html new file mode 100644 index 0000000..61cefb4 --- /dev/null +++ b/etc/template.html @@ -0,0 +1,153 @@ + + + + + + + $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ + + + +$if(title-before-toc)$ +

$title$

+$if(subtitle)$ +

$subtitle$

+$endif$ +$if(version)$ +

from git: $version$

+$endif$ +$endif$ +$if(toc)$ + +$endif$ +$body$ + + -- cgit v1.2.3