A Python script that reads in the latest living rules PDFs for High Frontier 4 core rules, appendix, module 1 & 2, and outputs a Markdown file which can then be converted to epub/pdf/html or whatever.
Advantages:
- When living rules get updated, the script can just be re-run to quickly check what has changed.
- Automatically generates links for the numerous references to other sections like "(D2)", "(1B6e)" etc., which allows quickly jumping back and forth between sections on Kindle or within a PDF reader.
- Option to generate a table of contents with a configurable level of depth.
Drawbacks:
- Does not yet include conversion of images, footnotes, or margin text. This works as a quick reference, but would probably not convenient for a first read through the rules.
- The layout of the victory point table in section M2 is not yet converted nicely. There might be other smaller layout glitches.
- Needs a working Python installation including the pdfplumber module (
pip install pdfplumber
) - Needs Pandoc for conversion from the generated Markdown file to the desired output format
- Download the latest living rules files
- Edit variable
hf4_input_files
inmain.py
to contain the paths to the downloaded files in the desired order - Run the script to create a Markdown file:
python main.py
(this outputs the PDF page number it is currently on and can take a minute or two) - Use Pandoc to convert the Markdown file to the desired output format, for example
- for epub:
pandoc hf4.md -o hf4.epub metadata.txt --toc-depth=2
(toc-depth is the desired depth for the table of contents) - for PDF:
pandoc hf4.md -o hf4.pdf metadata.txt --pdf-engine=xelatex --toc --toc-depth=1 -V geometry:margin=1in
(needs a LaTeX installation)
- for epub: