OSDN Git Service

Added function to generate unique file name, using an increasing counter.
[mutilities/MUtilities.git] / z_mkdocs.bat
1 @echo off
2 setlocal EnableDelayedExpansion
3
4 :: ------------------------------------------
5 :: Setup Paths
6 :: ------------------------------------------
7
8 set "PATH_PANDOC=C:\Program Files (x86)\Pandoc"
9
10 :: ------------------------------------------
11 :: Create Documents
12 :: ------------------------------------------
13
14 echo ===========================================================================
15 echo Building software documentation..."
16 echo ===========================================================================
17 echo.
18
19 for %%i in ("%~dp0\*.md") do (
20         echo PANDOC: %%~nxi
21         "%PATH_PANDOC%\pandoc.exe" --from markdown_github+pandoc_title_block+header_attributes --to html5 --toc -N --standalone -H "%~dp0\etc\style\style.css" "%%~i" --output "%%~dpni.html"
22         if not "!ERRORLEVEL!"=="0" (
23                 echo.
24                 echo Something went wrong^^!
25                 echo.
26                 pause && exit
27         )
28 )
29
30 echo.