-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvert_to_pdf.bat
More file actions
51 lines (48 loc) · 1.58 KB
/
convert_to_pdf.bat
File metadata and controls
51 lines (48 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
@echo off
REM Batch script to convert Markdown to PDF with rendered Mermaid diagrams
REM This will open the HTML file in your default browser for printing
echo Rate Limiter Documentation Converter
echo =====================================
echo.
echo This script will:
echo 1. Convert Rate Limiter.md to HTML
echo 2. Render Mermaid diagrams using Mermaid.js
echo 3. Open in your browser for PDF printing
echo.
REM Check if the HTML file exists
if exist "Rate Limiter.html" (
echo ✅ HTML file found: Rate Limiter.html
echo.
echo Opening in default browser...
start "" "Rate Limiter.html"
echo.
echo INSTRUCTIONS:
echo 1. Wait for diagrams to render (1-2 seconds)
echo 2. Press Ctrl+P to print
echo 3. Select "Save as PDF" or "Print to PDF"
echo 4. Use 'Narrow' margins for best results
echo 5. Click "Save" or "Print"
echo.
) else (
echo ❌ HTML file not found. Running conversion script first...
echo.
E:/repos/SystemDesign/.venv/Scripts/python.exe convert_to_pdf.py
if errorlevel 1 (
echo.
echo ❌ Conversion failed. Please check the errors above.
exit /b 1
)
echo.
echo Opening generated HTML file...
start "" "Rate Limiter.html"
)
echo.
echo 💡 TIPS:
echo • Mermaid diagrams render automatically using <pre class="mermaid"> tags
echo • Uses Mermaid.js ESM module for modern browser support
echo • Works offline after first CDN load
echo • For editing: Modify Rate Limiter.md and re-run this script
echo • Diagrams appear as visual flowcharts, not code blocks
echo.
echo Done!
pause