Kinscript converts genealogical markdown documents to PDFs via LaTeX. The main entry point is src/kinscript/cli.py which orchestrates:
- YAML frontmatter extraction
- Pandoc conversion (markdown → LaTeX)
- Lua filter processing (children tables, drop-caps)
- LaTeX post-processing (Python module)
- xelatex compilation (LaTeX → PDF)
The shell script kinscript.sh is a thin wrapper that calls the Python CLI via uv run kinscript.
kinscript.sh- Main shell script entry pointsrc/kinscript/- Python packageyaml_extract.py- YAML frontmatter parsinglatex_postprocess.py- LaTeX table formatting transforms
lua/kinscript_1.lua- Pandoc Lua filter for AST transformstex/template_kinscript_1.tex- LaTeX templatetests/- pytest test suite
uv run pytestWhen calling Python modules from shell scripts, always use uv run:
# Correct
uv run python3 -m kinscript.yaml_extract "$file"
# Wrong - may fail if package not in system Python
python3 -m kinscript.yaml_extract "$file"The children-table fenced divs in markdown are processed by the Lua filter. They use hanging indent paragraphs with \llap for column alignment rather than LaTeX table environments. This allows regular \footnote commands to work correctly (table environments require special \tablefootnote handling).
The Python module applies these transforms to generated .tex files:
- Replace LINEBREAK placeholder with
\\[6pt] - Fix minipage alignment (
[b]→[c]) - Wrap tables in tablebox environment
- Replace booktabs rules with hlines
- Format header text (uppercase, smaller font)