[fpc-pascal] Can fpdoc insert macro values or compiler version information?

Michael Van Canneyt michael at freepascal.org
Wed May 3 18:44:01 CEST 2017



On Wed, 3 May 2017, Graeme Geldenhuys wrote:

> Hi,
>
> Does FPDOC have the ability to inject the compiler version into RTL and
> FCL documentation? Something like FPC's macro variables or something.

No, because it does not know this information. It has no way of knowing.
At best it knows the version of FPC that fpdoc itself was compiled with.

But that doesn't necessarily equal the version of the compiler used to
compile the units with.

> eg: in the RTL Package Overview contents?
>
> eg:
>  Inside the "Description" content of this page:
>
>    https://www.freepascal.org/docs-html/rtl/
>
>
> The reason I ask, is because some output formats of fpdoc doesn't
> contain the FPC version it relates to. In fact, only the PDF
> documention, and I think that is accomplished manually via a LaTeX template.
>
> If I look at the content of the above URL, no version number is
> mentioned. If I look at INF or CHM generated documentation of the RTL or
> FCL, the same problem exists. One can't determine which FPC version
> those docs relate too.
>
> Thinking about this a bit more, if fpdoc had (or has) the ability to do
> macro variable replacements when generating documentation, macro values
> or definitions could be passed via the command line, and such
> information inserted in all documentation of various libraries and
> frameworks that use fpdoc to generate class documentation. eg: the
> version of the fpGUI's INF file, or the version of the LCL.chm file etc.

I deliberately do not wish to support this.

It would require preprocessing the whole file before it is fed to the XML engine.
So this kind of things can then equally well be done using some specialized preprocessor; 
m4 or sed or so.

An alternative could be to use a special footer template in the generated HTML.
We have this for generating the date or a search box. This could be used to
insert a version number on each page.

Patches that automate this approach in the documentation are welcome.

Michael.



More information about the fpc-pascal mailing list