Files
akmon/md2pdf.bat
2026-01-20 08:04:15 +08:00

23 lines
527 B
Batchfile

@echo off
REM Markdown to PDF with Mermaid support
REM Usage: md2pdf.bat input.md output.pdf
if "%~2"=="" (
echo Usage: %0 input.md output.pdf
exit /b 1
)
set INPUT=%~1
set OUTPUT=%~2
echo Converting %INPUT% to %OUTPUT% with Mermaid support...
REM Use pandoc with mermaid-filter to convert markdown to PDF
pandoc "%INPUT%" -o "%OUTPUT%" --filter mermaid-filter --pdf-engine=pdflatex
if %errorlevel% equ 0 (
echo Conversion completed successfully!
) else (
echo Conversion failed!
exit /b %errorlevel%
)