Some checks failed
build_docker / essential (push) Successful in 0s
build_docker / build_paddle_ocr (push) Successful in 4m57s
build_docker / build_raytune (push) Has been cancelled
build_docker / build_easyocr_gpu (push) Has been cancelled
build_docker / build_doctr (push) Has been cancelled
build_docker / build_doctr_gpu (push) Has been cancelled
build_docker / build_paddle_ocr_gpu (push) Has been cancelled
build_docker / build_easyocr (push) Has been cancelled
3.4 KiB
3.4 KiB
Generate the Word document for this Master's Thesis project.
Instructions
Execute the TFM document generation pipeline in order:
Step 0: Clean Up Previous Output
Remove the entire thesis_output folder to ensure a fresh build:
rm -rf thesis_output && mkdir -p thesis_output/figures
Step 1: Generate Figures from Mermaid Diagrams
Run the figure generation script using the virtual environment:
source .venv/bin/activate && python3 generate_mermaid_figures.py
Input: Mermaid code blocks from docs/*.md
Output: thesis_output/figures/figura_*.png and figures_manifest.json
Notes:
- Bar charts (
xychart-beta) are automatically post-processed to use light blue (#0098CD) bars - The script generates SVG first, replaces default colors, then converts to PNG via
cairosvg - Other diagram types (flowchart, sequence, pie) use direct PNG generation via
mmdc
Step 2: Apply Content to UNIR Template
Run the content application script using the virtual environment:
source .venv/bin/activate && python3 apply_content.py
Input:
instructions/plantilla_individual.htm(UNIR template)instructions/plantilla_individual_files/(template support files)docs/*.md(chapter content)thesis_output/figures/*.png(generated figures)
Output: thesis_output/ (htm + support files + figures)
Step 3: Report Results
After successful execution, provide:
- Number of figures generated
- Number of tables formatted
- Path to output file
- Instructions for Word finalization:
- Open
thesis_output/plantilla_individual.htmin Microsoft Word - Press Ctrl+A then F9 to update all indices (contents, figures, tables)
- Adjust image sizes if needed (select image → right-click → Size and Position)
- Save as
.docx
- Open
Prerequisites
If scripts fail, check that dependencies are installed:
# Python dependencies (in .venv)
source .venv/bin/activate && pip install beautifulsoup4 cairosvg
# Mermaid CLI for figure generation
npm install @mermaid-js/mermaid-cli
Notes
- Bar chart colors: The
generate_mermaid_figures.pyscript automatically converts xychart-beta bar colors to UNIR light blue (#0098CD). This is done via SVG post-processing since Mermaid's xychart theming doesn't work reliably via config files. - Color replacement: Both
fillandstrokeattributes are replaced for colors#ECECFFand#FFF4DD(default Mermaid bar colors). - Config file:
mermaid.config.jsonin root directory sets the base theme for all diagrams.
Error Handling
- If
generate_mermaid_figures.pyfails: Check mmdc (mermaid-cli) is installed - If
apply_content.pyfails: Check beautifulsoup4 is installed - Report any errors with the specific step that failed
Observed Issues (Local)
generate_mermaid_figures.pymay fail on macOS with errors like:Running as root without --no-sandbox is not supportedFailed to launch the browser process/MachPortRendezvousServerpermission errors
- If that happens, verify the Puppeteer config in
tem/scripts/puppeteer_config.jsonis picked up bygenerate_mermaid_figures.pyand includes:"args": ["--no-sandbox", "--disable-setuid-sandbox"]"executablePath"pointing to the local Chrome binary, e.g./Applications/Google Chrome.app/Contents/MacOS/Google Chrome
- If the error persists, rerun Step 1 with escalated permissions.