1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Improve <xref> vs. <command> formatting in the documentation

SQL commands are generally marked up as <command>, except when a link
to a reference page is used using <xref>.  But the latter doesn't
create monospace markup, so this looks strange especially when a
paragraph contains a mix of links and non-links.

We considered putting <command> in the <refentrytitle> on the target
side, but that creates some formatting side effects elsewhere.
Generally, it seems safer to solve this on the link source side.

We can't put the <xref> inside the <command>; the DTD doesn't allow
this.  DocBook 5 would allow the <command> to have the linkend
attribute itself, but we are not there yet.

So to solve this for now, convert the <xref>s to <link> plus
<command>.  This gives the correct look and also gives some more
flexibility what we can put into the link text (e.g., subcommands or
other clauses).  In the future, these could then be converted to
DocBook 5 style.

I haven't converted absolutely all xrefs to SQL command reference
pages, only those where we care about the appearance of the link text
or where it was otherwise appropriate to make the appearance match a
bit better.  Also in some cases, the links where repetitive, so in
those cases the links where just removed and replaced by a plain
<command>.  In cases where we just want the link and don't
specifically care about the generated link text (typically phrased
"for further information see <xref ...>") the xref is kept.

Reported-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Discussion: https://www.postgresql.org/message-id/flat/87o8pco34z.fsf@wibble.ilmari.org
This commit is contained in:
Peter Eisentraut
2020-10-03 16:16:51 +02:00
parent 1a9388bd0f
commit 9081bddbd7
92 changed files with 348 additions and 346 deletions

View File

@@ -71,7 +71,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
<listitem>
<para>
This form adds a new column to the foreign table, using the same syntax as
<xref linkend="sql-createforeigntable"/>.
<link linkend="sql-createforeigntable"><command>CREATE FOREIGN TABLE</command></link>.
Unlike the case when adding a column to a regular table, nothing happens
to the underlying storage: this action simply declares that
some new column is now accessible through the foreign table.
@@ -133,8 +133,8 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
<para>
This form
sets the per-column statistics-gathering target for subsequent
<xref linkend="sql-analyze"/> operations.
See the similar form of <xref linkend="sql-altertable"/>
<link linkend="sql-analyze"><command>ANALYZE</command></link> operations.
See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link>
for more details.
</para>
</listitem>
@@ -146,7 +146,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
<listitem>
<para>
This form sets or resets per-attribute options.
See the similar form of <xref linkend="sql-altertable"/>
See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link>
for more details.
</para>
</listitem>
@@ -159,7 +159,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
<listitem>
<para>
This form sets the storage mode for a column.
See the similar form of <xref linkend="sql-altertable"/>
See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link>
for more details.
Note that the storage mode has no effect unless the table's
foreign-data wrapper chooses to pay attention to it.
@@ -172,7 +172,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
<listitem>
<para>
This form adds a new constraint to a foreign table, using the same
syntax as <xref linkend="sql-createforeigntable"/>.
syntax as <link linkend="sql-createforeigntable"><command>CREATE FOREIGN TABLE</command></link>.
Currently only <literal>CHECK</literal> constraints are supported.
</para>
@@ -181,7 +181,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
done to verify the constraint is correct; rather, this action simply
declares that some new condition should be assumed to hold for all rows
in the foreign table. (See the discussion
in <xref linkend="sql-createforeigntable"/>.)
in <link linkend="sql-createforeigntable"><command>CREATE FOREIGN TABLE</command></link>.)
If the constraint is marked <literal>NOT VALID</literal>, then it isn't
assumed to hold, but is only recorded for possible future use.
</para>
@@ -216,7 +216,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
<listitem>
<para>
These forms configure the firing of trigger(s) belonging to the foreign
table. See the similar form of <xref linkend="sql-altertable"/> for more
table. See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link> for more
details.
</para>
</listitem>
@@ -239,7 +239,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
<para>
This form adds the target foreign table as a new child of the specified
parent table.
See the similar form of <xref linkend="sql-altertable"/>
See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link>
for more details.
</para>
</listitem>
@@ -503,7 +503,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
</para>
<para>
Refer to <xref linkend="sql-createforeigntable"/> for a further description of valid
Refer to <link linkend="sql-createforeigntable"><command>CREATE FOREIGN TABLE</command></link> for a further description of valid
parameters.
</para>
</refsect1>