Uvilo Method Release
Purpose
Format and publish a new dated version of “The Uvilo Method” document.
When to Use
- User says “release The Uvilo Method” or “publish new Uvilo Method version”
- User references updating/formatting The Uvilo Method document
Prerequisites
pandocinstalled (confirmed at/usr/local/bin/pandoc)weasyprintinstalled (confirmed at/usr/local/bin/weasyprint)- Google Drive for Desktop running (Shared drives mounted)
- Fonts directory must exist at
{ORG}/Assets/fonts/with required font files (SofiaSans, Exo2 variants)- If missing, PDF generation will fail with error:
withBinaryFile: does not exist - CSS references fonts via relative path
../fonts/from Themes folder
- If missing, PDF generation will fail with error:
Constants
How to Run
Automated
Or with a specific date:
What the Script Does
- Duplicate source →
The Uvilo Method {DATE}.md - Stamp version — replaces
Version: YYYY-MM-DDwith current date - Generate GitHub-flavor TOC — replaces
\[\[Table of Contents]]in the .md with GitHub-style anchors (keeps leading numbers) - Create pandoc temp file — a second copy with pandoc-compatible TOC anchors (strips leading numbers) used only for PDF/DOCX generation
- Generate PDF — via pandoc + weasyprint with uvilo.css theme (from pandoc temp file)
- Generate DOCX — via pandoc from pandoc temp file (Google Drive auto-converts to Google Docs)
- Copy outputs to:
{SOURCE_FOLDER}/.../The Uvilo Method {DATE}/
Notes
- Native
.gdoccannot be created locally. The.docxplaced in Google Drive auto-converts. - The .md file uses GitHub-flavor TOC anchors (keeps leading heading numbers like
1.,1.1). PDF and DOCX are generated from a temporary pandoc-compatible copy (strips leading numbers to match pandoc’s auto-generated IDs). - GitHub-flavor anchors preserve Unicode characters (like ° in “360°”) to match modern markdown viewers (Cursor, VS Code, etc.)
- TOC only includes H1 and H2 headings.
- Working directory for pandoc is SOURCE_DIR (so relative CSS paths work).
generate-toc.tsaccepts--style github(default) or--style pandoc.
Troubleshooting & Known Issues
PDF Generation Errors
Anchor warnings (cosmetic, non-breaking):
- Error:
No anchor #uvilo-360°-life-review for internal URI reference - Cause: weasyprint/pandoc generate different anchor IDs than GitHub-style TOC links
- Impact: PDF renders correctly; only in-PDF navigation from TOC links is affected
- Resolution: This is expected behavior and can be ignored
Missing fonts error:
- Error:
withBinaryFile: does not exist (No such file or directory)for font files - Cause: Fonts directory missing at
{ORG}/Assets/fonts/ - Resolution: Ensure fonts directory exists with required SofiaSans and Exo2 font files
TOC Anchor Generation
Pandoc anchor ID rules:
- Pandoc strips leading section numbers (e.g.,
1.,1.1,4.2.) from heading anchor IDs - Pattern:
^[\d]+(?:\.[\d]+)*\.?\s+ - TOC generators must match this behavior for consistent anchors
Unicode handling:
- Modern markdown viewers (Cursor, VS Code) preserve Unicode characters (like °) in anchor IDs
- Use specific punctuation removal (periods, commas, quotes, brackets) rather than blanket non-word character removal
- Matches CommonMark behavior
Script Development Notes
Bash heredoc limitations:
- Unquoted heredoc delimiters (
<< EOF) interpret backticks as command substitution - When embedding code containing backticks, extract to separate file and call it instead
- Prevents command substitution issues in embedded Python/code blocks