Add option to include source files in ConTeXt PDFs (#5578)
Add a metadata option (`includesource`) to attach the source documents to the resulting PDF.
commit09f30d65e43c3099fb13960232576f06f0c29343
authorTristan Stenner <ttstenner@gmail.com>
dateTue 16 Jul 2019, 18:31 (7 years ago)
parent5454aad
MANUAL.txt+3
@@ -1828,6 +1828,9 @@ Pandoc uses these variables when [creating a PDF] with ConTeXt.
18281828`whitespace`
18291829: spacing between paragraphs, e.g. `none`, `small` (using [`setupwhitespace`])
18301830
1831+`includesource`
1832+: include all source documents as file attachments in the PDF file
1833+
18311834[ConTeXt Paper Setup]: https://wiki.contextgarden.net/PaperSetup
18321835[ConTeXt Layout]: https://wiki.contextgarden.net/Layout
18331836[ConTeXt Font Switching]: https://wiki.contextgarden.net/Font_Switching
data/templates/default.context+5
@@ -105,6 +105,11 @@ $endif$
105105\setupxtable[body][]
106106\setupxtable[foot][bottomframe=on]
107107
108+$if(includesource)$
109+$for(sourcefile)$
110+\attachment[file=$curdir$/$sourcefile$,method=hidden]
111+$endfor$
112+$endif$
108113$for(header-includes)$
109114$header-includes$
110115$endfor$