|
|
Subject: Code examples
From: tgl@sss.pgh.pa.us (Tom Lane)
Date: 9/4/2007 10:11:30 AM
Peter Eisentraut <peter_e@gmx.net> writes:
> Am Dienstag, 4. September 2007 02:39 schrieb Tom Lane:
>> C code that's been hacked until it passes for SGML isn't compilable.
> I don't understand this point. Why would SGML care what the C code looks
> like?
&, <, and > need to be hacked so that SGML doesn't barf on them.
Unfortunately, all three symbols are a bit commonplace in C code.
Now admittedly this can be fixed with moderately simple
search-and-replaces, but it's still another obstacle in the path of
someone who actually wishes to use the code for its intended purpose,
or even someone who would like to find out if the examples aren't
broken.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
Subject: Code examples
From: tgl@sss.pgh.pa.us (Tom Lane)
Date: 9/4/2007 12:19:14 PM
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Maybe we could set things up so that there are actual files which are
> programatically preprocessed to SGML to be included in the docs? That
> way, the docs always reflect the actual file, which by itself is
> compilable. The SGML source would only contain something like
> <include file="examples/foo.c" /> or something like that.
Well, if we have actual contrib modules (which is still a good idea
so that they get tested on a regular basis), I don't see any need to
copy the code into the docs at all. The docs should just say "a working
example can be found in contrib/whatever".
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
|