For the first challenge, we developed an internal tool, based on public open-source components, to translate a Markdown file into a branded PDF. The solution is based on [Pandoc](https://pandoc.org/) and [`\LaTeX`{=tex}](https://www.latex-project.org/) in the backend, while the user only writes Markdown. Languages such as HTML and `\LaTeX `{=tex}can also be used in the text if desired. On top of that, we developed some LUA scripts as a filter for Pandoc, which allows us to create and resolve variables that a user can define in a YAML metadata block. These variables can also be used to load pieces of text per condition like an If-Else statement. With that, we can easily define a variable for a customer name and switch a template from one customer to another. Or we can use a piece of text if a condition is true, such as 'high-availability = true'. Furthermore, we can convert multiple Markdown files into a single PDF output. This allows us to have a single main document, and maybe some chapters as an individual document shared between different team members if needed, or specific text block highly reusable shared between all users, such as disclaimers, safe harbor statements, product descriptions etc. Such snippets can then be centrally managed and updated, with the end users just retaining the reference to the snippets, not needing to update their documents.
0 commit comments