2017-06-16 13:11:41 +00:00
|
|
|
@echo off
|
2018-06-18 15:48:00 +00:00
|
|
|
title A2osX DOC generator
|
2019-04-14 15:45:02 +00:00
|
|
|
COLOR 0A
|
2017-06-16 13:11:41 +00:00
|
|
|
prompt ]
|
|
|
|
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
|
|
|
|
|
|
|
for /f %%a in ('copy /Z "%~f0" nul') do set "CR=%%a"
|
|
|
|
|
|
|
|
mode con:cols=80 lines=24
|
|
|
|
|
|
|
|
cls
|
2022-09-04 20:12:49 +00:00
|
|
|
echo Apple //e
|
2017-06-16 13:11:41 +00:00
|
|
|
|
|
|
|
set /a c=0
|
|
|
|
|
|
|
|
if not exist "%~dp0..\.Docs" md "%~dp0..\.Docs"
|
|
|
|
|
|
|
|
set DOCFILE=%~dp0..\.Docs\KERNEL.md
|
|
|
|
set SRCDIR=%~dp0..\SYS
|
|
|
|
set FILTER=KERNEL.S*.txt
|
|
|
|
Call :SCAN
|
|
|
|
|
|
|
|
set DOCFILE=%~dp0..\.Docs\LIBBLKDEV.md
|
|
|
|
set SRCDIR=%~dp0..\LIB
|
|
|
|
set FILTER=LIBBLKDEV.S*.txt
|
|
|
|
Call :SCAN
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
set DOCFILE=%~dp0..\.Docs\LIBTUI.md
|
|
|
|
set SRCDIR=%~dp0..\LIB
|
|
|
|
set FILTER=LIBTUI.S*.txt
|
|
|
|
Call :SCAN
|
|
|
|
|
2018-06-18 15:48:00 +00:00
|
|
|
set DOCFILE=%~dp0..\.Docs\LIBGUI.md
|
|
|
|
set SRCDIR=%~dp0..\LIB
|
|
|
|
set FILTER=LIBGUI.S*.txt
|
|
|
|
Call :SCAN
|
|
|
|
|
|
|
|
set DOCFILE=%~dp0..\.Docs\LIBPAK.md
|
|
|
|
set SRCDIR=%~dp0..\LIB
|
|
|
|
set FILTER=LIBPAK.S*.txt
|
|
|
|
Call :SCAN
|
|
|
|
|
|
|
|
set DOCFILE=%~dp0..\.Docs\LIBTCPIP.md
|
|
|
|
set SRCDIR=%~dp0..\LIB
|
|
|
|
set FILTER=LIBTCPIP.S*.txt
|
|
|
|
Call :SCAN
|
|
|
|
|
2021-07-29 16:41:57 +00:00
|
|
|
set DOCFILE=%~dp0..\.Docs\LIBCRYPT.md
|
|
|
|
set SRCDIR=%~dp0..\LIB
|
|
|
|
set FILTER=LIBCRYPT.S*.txt
|
|
|
|
Call :SCAN
|
|
|
|
|
2021-05-24 13:27:51 +00:00
|
|
|
set DOCFILE=%~dp0..\.Docs\Commands.md
|
|
|
|
set SRCDIR=%~dp0..\BIN
|
|
|
|
set FILTER=*.S.txt
|
|
|
|
Call :SCAN
|
|
|
|
|
|
|
|
|
2017-06-16 13:11:41 +00:00
|
|
|
echo.
|
|
|
|
echo All done : !c! Files scanned.
|
|
|
|
echo.
|
|
|
|
echo (I know, this batch is stupid ;-)
|
|
|
|
echo.
|
|
|
|
pause
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
|
|
|
|
:SCAN
|
|
|
|
(echo *** Auto generated by docgen.cmd *** )>!DOCFILE!
|
2019-04-14 15:45:02 +00:00
|
|
|
(echo.)>>!DOCFILE!
|
|
|
|
(echo ## Copyright )>>!DOCFILE!
|
2020-01-14 19:29:13 +00:00
|
|
|
(echo Copyright 2015 - 2020, Remy Gibert and the A2osX contributors. )>>!DOCFILE!
|
2017-06-16 13:11:41 +00:00
|
|
|
|
|
|
|
echo.
|
|
|
|
echo Scanning %FILTER% Files...
|
|
|
|
|
|
|
|
for /f %%F in ('dir /b /ogn "%SRCDIR%\%FILTER%"') do (
|
|
|
|
set FN=%%F
|
|
|
|
set /a c+=1
|
|
|
|
set /p "=!c! - !FN! !CR!" <NUL
|
|
|
|
set bInDoc=0
|
|
|
|
for /F "tokens=*" %%L in ('type "%SRCDIR%\!FN!"') do (
|
|
|
|
set LINE=%%L
|
|
|
|
if defined LINE (
|
|
|
|
set bOut=1
|
|
|
|
if "!LINE:~0,2!" EQU "*/" (
|
|
|
|
set bInDoc=1
|
|
|
|
set bOut=0
|
|
|
|
)
|
|
|
|
if "!LINE:~0,2!" EQU "*\" (
|
|
|
|
set bInDoc=0
|
|
|
|
set bOut=0
|
|
|
|
)
|
|
|
|
if !bInDoc! EQU 1 (
|
|
|
|
if !bOut! EQU 1 (
|
|
|
|
if "!line:~0,2!" EQU "* " set LINE=!LINE:~2!
|
2018-06-18 06:22:50 +00:00
|
|
|
if "!line:~0,1!" EQU "+" (
|
|
|
|
set bInList=1
|
|
|
|
) else (
|
|
|
|
if !bInList! EQU 1 (
|
|
|
|
echo.>>!DOCFILE!
|
|
|
|
set bInList=0
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if "!line:~0,1!" EQU "#" echo.>>!DOCFILE!
|
2018-06-18 08:44:02 +00:00
|
|
|
(echo !LINE! )>>!DOCFILE!
|
2017-06-16 13:11:41 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2019-04-14 15:45:02 +00:00
|
|
|
(type "%~dp0footer.txt")>>!DOCFILE!
|
|
|
|
(echo.)>>!DOCFILE!
|
|
|
|
(echo *** End of Auto generated file *** )>>!DOCFILE!
|