aboutsummaryrefslogtreecommitdiff
path: root/doc/doc.bat
blob: 80a63511edcccf25be5e593a4105388426e90753 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@echo off
setlocal
cd %~dp0

echo ^<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"^> > index.html
echo ^<html lang=en^> >> index.html
echo ^<head^> >> index.html
echo ^<title^>tt.c^<^/title^> >> index.html
echo ^</head^> >> index.html
echo ^<body^> >> index.html

for /f "tokens=*" %%f in ('dir /b/a-d ..\src') do (
  echo ^<h1^>%%f^</h1^> >> index.html
  awk -F """" "/^\/\// { sub(/^\/\/ */, """", $0); print gensub(/->[	 ]*([^	 ][^	 ]*)$/, ""\\\\&rarr;\\\\&nbsp;*\\\\1*"", $0); next } /^[	 ]*$/ { print """"; next } { print ""    "" $0 }" < ..\src\%%f | markdown.exe | sed -e "s/h2>/h3>/g" -e "s/h1>/h2>/g" >> index.html
  echo ^<hr^> >> index.html
)

echo ^</body^>^</html^> >> index.html