Sign in Join

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

Mailing lists / fpc-pascal / 2021-04

Trouble integrating examples into fpcdoc

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Noel Duffy

In the fpcdocs subversion project, there are a number of example directories each containing one or more small programs and a Makefile. My question is, is that Makefile automatically generated, or is it hand-crafted?

I'm writing documentation for the netdb module and want to add some example programs. I've created the first program and used an example tag to reference it within netdb.xml, and this works to show the example code in the generated html. But the example program isn't compiled.

Taking the fpcdocs/linuxex example directory, the Makefile references the single defined example, ex64.pp, at line 54:

OBJECTS=ex64

This line occurs after this warning:

####################################################################### # No need to edit after this line.
#######################################################################

Which suggests to me that the Makefiles are generated. But if so, how? I can't find anything in the Makefile.fpc at the fpcdocs root to reference them.

On the other hand, the Makefiles are committed to the repository, which does somewhat suggest that they're not generated.

Reply by email

Michael Van Canneyt
to Noel Duffy
Noel Duffy wrote
In the fpcdocs subversion project, there are a number of example directories each containing one or more small programs and a Makefile. My question is, is that Makefile automatically generated, or is it hand-crafted?

It is hand-crafted.

Show quoted text 5 lines
I'm writing documentation for the netdb module and want to add some example programs. I've created the first program and used an example tag to reference it within netdb.xml, and this works to show the example code in the generated html. But the example program isn't compiled.

None of the examples are compiled when you make the documentation.

Show quoted text 11 lines
Taking the fpcdocs/linuxex example directory, the Makefile references the single defined example, ex64.pp, at line 54: OBJECTS=ex64 This line occurs after this warning: ####################################################################### # No need to edit after this line. #######################################################################

The OBJECTS= line should be before that remark.

Michael.

Reply by email

Noel Duffy
to Michael Van Canneyt
Michael Van Canneyt wrote 10 lines
On Mon, 5 Apr 2021, Noel Duffy via fpc-pascal wrote: > In the fpcdocs subversion project, there are a number of example > directories each containing one or more small programs and a Makefile. > My question is, is that Makefile automatically generated, or is it > hand-crafted? It is hand-crafted.

Great, thanks. That makes the way ahead quite straightforward.

Show quoted text 9 lines
> > I'm writing documentation for the netdb module and want to add some > example programs. I've created the first program and used an example > tag to reference it within netdb.xml, and this works to show the > example code in the generated html. But the example program isn't > compiled. None of the examples are compiled when you make the documentation.

Yes, I realised after I'd posted it that I should have said when running "make examples" or "make linuxexamples".

Anyway, I have enough information now to start adding example programs.

Reply by email