Re: documentation structure
Corey Huinker <corey.huinker@gmail.com>
From: Corey Huinker <corey.huinker@gmail.com>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>, Andrew Dunstan <andrew@dunslane.net>, Robert Haas <robertmhaas@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-04-19T00:57:17Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
docs: Consistently use <optional> to indicate optional parameters
- 0d829703363b 18.0 landed
-
docs: Consolidate into new "WAL for Extensions" chapter.
- 09d9800e5282 17.0 landed
-
freespace: Don't return blocks past the end of the main fork.
- 935829743151 17.0 cited
-
docs: Merge separate chapters on built-in index AMs into one.
- fe8eaa54420c 17.0 landed
-
docs: Demote "Monitoring Disk Usage" from chapter to section.
- f470b5c67924 17.0 landed
-
doc: move system views section to its own chapter
- 64d364bb39cb 16.0 cited
> > Yeah, we can't expect everyone wanting to call a built-in function to > know how they would define an equivalent one themselves. In that case I > propos marking it up like this: > > <function>format</function> ( > <parameter>formatstr</parameter> <type>text</type> > <optional>, <parameter>formatarg</parameter> <type>"any"</type> > <optional>, ...</optional> </optional> ) > <returnvalue>text</returnvalue> > Looks good, but I guess I have to ask: is there a parameter-list tag out there instead of (, and should we be using that? > The requisite nesting when there are multiple optional parameters makes > it annoying to wrap and indent it "properly" per XML convention, but how > about something like this, with each parameter on a line of its own, and > all the closing </optional> tags on one line? > > <function>regexp_substr</function> ( > <parameter>string</parameter> <type>text</type>, > <parameter>pattern</parameter> <type>text</type> > <optional>, <parameter>start</parameter> <type>integer</type> > <optional>, <parameter>N</parameter> <type>integer</type> > <optional>, <parameter>flags</parameter> <type>text</type> > <optional>, <parameter>subexpr</parameter> <type>integer</type> > </optional> </optional> </optional> </optional> ) > <returnvalue>text</returnvalue> > Yes, that has an easy count-the-vertical, count-the-horizontal, do-they-match flow to it. > A lot of functions mostly follow this style, except they tend to put the > first parameter on the same line of the function namee, even when that > makes the line overly long. I propose going the other way, with each > parameter on a line of its own, even if the first one would fit after > the function name, except the whole parameter list fits after the > function name. > +1 > > Also, when there's only one optional argument, or they're independently > optional, not nested, the </optional> tag should go on the same line as > the parameter. > > <function>substring</function> ( > <parameter>bits</parameter> <type>bit</type> > <optional> <literal>FROM</literal> <parameter>start</parameter> > <type>integer</type> </optional> > <optional> <literal>FOR</literal> <parameter>count</parameter> > <type>integer</type> </optional> ) > <returnvalue>bit</returnvalue> > +1