fbdoc & msxbasicdoc

Documentatie voor BASIC-programma's · Documentation for BASIC programs

Nederlands | English | GitHub | Demo fbdoc | Demo msxbasicdoc

Wat is het?

Twee kleine commandline-tools die documentatie maken uit BASIC-broncode. Beide zijn geschreven in FreeBASIC en hebben geen extra bibliotheken nodig.

ToolVoorUitvoer
fbdocFreeBASIC (.bas, .bi) text, Markdown, HTML, JSON, Graphviz, Mermaid, aanroepboom
msxbasicdocMSX-BASIC (ASCII) HTML, optioneel Graphviz

fbdoc

Een soort javadoc voor FreeBASIC. fbdoc leest het commentaar boven elke declaratie, herkent tags als @param, @return en @see, en maakt er nette documentatie van. Ontbreekt het commentaar, dan bedenkt fbdoc een beschrijving op basis van de naam en de parameters.

'' Telt twee getallen op.
'' @param a  eerste getal
'' @param b  tweede getal
'' @return de som
Function Som(ByVal a As Integer, ByVal b As Integer) As Integer
fbdoc -f html -o api.html -n "Mijn project" ./src

msxbasicdoc

Brengt de structuur van een MSX-BASIC-programma in kaart door GOTO, GOSUB en RETURN te volgen. Het resultaat is één HTML-pagina met de routines, een aanroepgraaf, de gebruikte variabelen en waarschuwingen.

Sla het programma op de MSX op als ASCII: SAVE "NAAM.BAS",A

1000 '## TekenRand - tekent een rand om het scherm
1010 '@in  K = kleur
1020 ' Wist eerst het scherm.
msxbasicdoc -dot SPEL.BAS

Compileren

Installeer de FreeBASIC-compiler en voer uit:

fbc -lang fblite -s console fbdoc/fbdoc.bas
fbc -lang fblite msxbasicdoc/msxbasicdoc.bas

Downloaden

De broncode, de volledige handleiding (README) en de wijzigingen (CHANGELOG) staan op GitHub.


What is it?

Two small command-line tools that generate documentation from BASIC source code. Both are written in FreeBASIC and need no extra libraries.

ToolForOutput
fbdocFreeBASIC (.bas, .bi) text, Markdown, HTML, JSON, Graphviz, Mermaid, call tree
msxbasicdocMSX-BASIC (ASCII) HTML, optionally Graphviz

fbdoc

A javadoc-style generator for FreeBASIC. fbdoc reads the comment above each declaration, understands tags such as @param, @return and @see, and turns it into clean documentation. Where comments are missing, it derives a description from the name and parameters. Use -l en for English generated text.

'' Adds two numbers.
'' @param a  first number
'' @param b  second number
'' @return the sum
Function Sum(ByVal a As Integer, ByVal b As Integer) As Integer
fbdoc -f html -l en -o api.html -n "My project" ./src

msxbasicdoc

Maps the structure of an MSX-BASIC program by following GOTO, GOSUB and RETURN. The result is a single HTML page with the routines, a call graph, the variables used and warnings.

Save the program on the MSX as ASCII: SAVE "NAME.BAS",A

1000 '## DrawBorder - draws a border around the screen
1010 '@in  K = colour
1020 ' Clears the screen first.
msxbasicdoc -dot GAME.BAS

Building

Install the FreeBASIC compiler and run:

fbc -lang fblite -s console fbdoc/fbdoc.bas
fbc -lang fblite msxbasicdoc/msxbasicdoc.bas

Download

Source code, the full manual (README) and the changelog are on GitHub.