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

@@ -81,7 +81,7 @@ ALTER INDEX ALL IN TABLESPACE <replaceable class="parameter">name</replaceable>
this command, use <command>ALTER DATABASE</command> or explicit
<command>ALTER INDEX</command> invocations instead if desired.
See also
<xref linkend="sql-createtablespace"/>.
<link linkend="sql-createtablespace"><command>CREATE TABLESPACE</command></link>.
</para>
</listitem>
</varlistentry>
@@ -118,11 +118,11 @@ ALTER INDEX ALL IN TABLESPACE <replaceable class="parameter">name</replaceable>
<para>
This form changes one or more index-method-specific storage parameters
for the index. See
<xref linkend="sql-createindex"/>
<link linkend="sql-createindex"><command>CREATE INDEX</command></link>
for details on the available parameters. Note that the index contents
will not be modified immediately by this command; depending on the
parameter you might need to rebuild the index with
<xref linkend="sql-reindex"/>
<link linkend="sql-reindex"><command>REINDEX</command></link>
to get the desired effects.
</para>
</listitem>
@@ -144,7 +144,7 @@ ALTER INDEX ALL IN TABLESPACE <replaceable class="parameter">name</replaceable>
<listitem>
<para>
This form sets the per-column statistics-gathering target for
subsequent <xref linkend="sql-analyze"/> operations, though can
subsequent <link linkend="sql-analyze"><command>ANALYZE</command></link> operations, though can
be used only on index columns that are defined as an expression.
Since expressions lack a unique name, we refer to them using the
ordinal number of the index column.
@@ -252,7 +252,7 @@ ALTER INDEX ALL IN TABLESPACE <replaceable class="parameter">name</replaceable>
<para>
These operations are also possible using
<xref linkend="sql-altertable"/>.
<link linkend="sql-altertable"><command>ALTER TABLE</command></link>.
<command>ALTER INDEX</command> is in fact just an alias for the forms
of <command>ALTER TABLE</command> that apply to indexes.
</para>