A2osX/_Tools/docgen.cmd
2016-10-22 10:33:22 +02:00

35 lines
707 B
Batchfile

@echo off
title Kernel DOC generator
COLOR 2A
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
set DOCFILE=%~dp0..\_Docs\KERNEL.md
echo # A2osX Kernel API >!DOCFILE!
echo *** Auto generated by docgen.cmd *** >!DOCFILE!
for /f %%F in ('dir /b /ogn %~dp0..\SYS\KERNEL.S*.txt') do (
set FN=%%F
echo Filename : !FN!
set bInDoc=0
for /F "tokens=*" %%L in (%~dp0..\SYS\!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 (
echo !LINE:~2! >>!DOCFILE!
)
)
)
)
)