[fpc-pascal] FPDoc now with Markdown support
Michael Van Canneyt
michael at freepascal.org
Sat Jan 2 15:31:11 CET 2021
Hello !
I didn't make it quite in time for the new year, but still:
The fpdoc engine (what is used to document the FPC & Lazarus units)
is now capable of outputting the documentation in markdown.
This can be used as input for mkdocs or another engine such as sphinx.
As a first engine, I tackled mkdocs.
Compare the official page for TObject.Dispatch:
https://www.freepascal.org/docs-html/current/rtl/system/tobject.dispatch.html
With the following pages:
They are all the same documentation page, but just use a different theme for mkdocs:
gitbook theme:
https://www.freepascal.org/~michael/docs-demo/gitbook/system/tobject.dispatch/
ivory theme:
https://www.freepascal.org/~michael/docs-demo/ivory/system/tobject.dispatch/
windmill theme: (seems broken)
https://www.freepascal.org/~michael/docs-demo/windmill/system/tobject.dispatch/
windmill dark theme: (seems broken)
https://www.freepascal.org/~michael/docs-demo/windmill-dark/system/tobject.dispatch/
docskimmer theme:
https://www.freepascal.org/~michael/docs-demo/docskimmer/system/tobject.dispatch/
default (mkdocs) theme:
https://www.freepascal.org/~michael/docs-demo/windmill-dark/system/tobject.dispatch/
readthedocs theme:
https://www.freepascal.org/~michael/docs-demo/readthedocs/system/tobject.dispatch/
material theme:
https://www.freepascal.org/~michael/docs-demo/material/system/tobject.dispatch/
Some themes work better than others.
Fun fact:
Generating the documentation in HTML with fpdoc takes a couple of seconds.
Depending on the theme, generating the docs with mkdocs (written in Python)
takes 3-7 minutes.
Just shows that Pascal code is very efficient, I suppose... ;-)
I've been looking at allowing markdown for the description files (they would
be less verbose then), but there seems to be no decent markdown parser available
for pascal. If somone cares to contribute one...
Enjoy,
Michael.
More information about the fpc-pascal
mailing list