I would like to be able to "turn on/off" certain sections of my documents, depending on a command line declaration.
I am converting a large group of policy documents that are for both internal and external use, via Pandoc, to PDF, using a LaTeX template, and Pandoc is using pdfTeX. I also have a PowerShell script that converts them recursively.
gci -r -i *.md | foreach{$pdf=$_.directoryname+"\"+$_.basename+".pdf"; pandoc -f markdown --template template.latex -V geometry:margin=1.5cm -V fontfamily:lato -V fontfamilyoptions:default -V fontfamilyoptions:defaultsans -s $_.name -o $pdf}
External versions don't need the document details section, which is the first page after the table of contents. I could probably remove the third page, but there are some documents with long ToC's, and some without, besides which, it doesn't strike me as a an elegant solution.
My typical document looks something like this (YAML and content reduced for brevity):
---
title: "A policy"
documentdetails: True/false % I could add something here for the default?
...
Table of contents:
\documentdetailstart % A tag looking like this for instance
# Document Details
#### Document Details
| Description | Status/Version | Reference Code | Control |
| --- |---|---|---|
|A Policy | Final / 1.0 | LaTeX | All |
\documentdetailend % A tag looking like this for instance
Begin Document
How can I add some kind of wrapping to the markdown of each policy, that is dealt with in the template perhaps, so that I can add something like the below on the command line to automatically omit/include the contents of the tag.
-V Documentdetails:True
Thanks in advance for any assistance you can provide!