Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-05

Can fpdoc insert macro values or compiler version information?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Does FPDOC have the ability to inject the compiler version into RTL and FCL documentation? Something like FPC's macro variables or something. 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.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp
Michael Van Canneyt
to Graeme Geldenhuys
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.

Show quoted text 23 lines
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.

Graeme Geldenhuys
to Michael Van Canneyt
Michael Van Canneyt wrote
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.

I thought that much [after I sent my email].

I deliberately do not wish to support this. It would require preprocessing the whole file before it is fed to the XML engine.

True, and that could slow things down a lot or cause other side effects.

Thanks for the reply. I'll give this some more thought and see if I can up up with an alternate solution.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp