1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-22 17:42:17 +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

@@ -37,9 +37,9 @@ BEGIN [ WORK | TRANSACTION ] [ <replaceable class="parameter">transaction_mode</
<para>
<command>BEGIN</command> initiates a transaction block, that is,
all statements after a <command>BEGIN</command> command will be
executed in a single transaction until an explicit <xref
linkend="sql-commit"/> or <xref
linkend="sql-rollback"/> is given.
executed in a single transaction until an explicit <link
linkend="sql-commit"><command>COMMIT</command></link> or <link
linkend="sql-rollback"><command>ROLLBACK</command></link> is given.
By default (without <command>BEGIN</command>),
<productname>PostgreSQL</productname> executes
transactions in <quote>autocommit</quote> mode, that is, each
@@ -60,7 +60,7 @@ BEGIN [ WORK | TRANSACTION ] [ <replaceable class="parameter">transaction_mode</
<para>
If the isolation level, read/write mode, or deferrable mode is specified, the new
transaction has those characteristics, as if
<xref linkend="sql-set-transaction"/>
<link linkend="sql-set-transaction"><command>SET TRANSACTION</command></link>
was executed.
</para>
</refsect1>
@@ -90,13 +90,13 @@ BEGIN [ WORK | TRANSACTION ] [ <replaceable class="parameter">transaction_mode</
<title>Notes</title>
<para>
<xref linkend="sql-start-transaction"/> has the same functionality
<link linkend="sql-start-transaction"><command>START TRANSACTION</command></link> has the same functionality
as <command>BEGIN</command>.
</para>
<para>
Use <xref linkend="sql-commit"/> or
<xref linkend="sql-rollback"/>
Use <link linkend="sql-commit"><command>COMMIT</command></link> or
<link linkend="sql-rollback"><command>ROLLBACK</command></link>
to terminate a transaction block.
</para>
@@ -131,7 +131,7 @@ BEGIN;
<para>
<command>BEGIN</command> is a <productname>PostgreSQL</productname>
language extension. It is equivalent to the SQL-standard command
<xref linkend="sql-start-transaction"/>, whose reference page
<link linkend="sql-start-transaction"><command>START TRANSACTION</command></link>, whose reference page
contains additional compatibility information.
</para>