Обсуждение: Doc anchors for COPY formats

Поиск
Список
Период
Сортировка

Doc anchors for COPY formats

От
Dagfinn Ilmari Mannsåker
Дата:
Hi hackers,

An IRC conversation just now made me notice that it would be handy to
have stable links for the descrpitions of the various COPY formats, per
the attached patch.

- ilmari

From 5e59273370a39cd46627b89145a7c06dd6f00f7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Thu, 25 Apr 2024 12:09:14 +0100
Subject: [PATCH] Add anchors for COPY format descriptions

---
 doc/src/sgml/ref/copy.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml
index 1ce19668d8..6851293854 100644
--- a/doc/src/sgml/ref/copy.sgml
+++ b/doc/src/sgml/ref/copy.sgml
@@ -630,7 +630,7 @@
  <refsect1>
   <title>File Formats</title>
 
-  <refsect2>
+  <refsect2 id="sql-copy-text-format">
    <title>Text Format</title>
 
    <para>
@@ -770,7 +770,7 @@
    </para>
   </refsect2>
 
-  <refsect2>
+  <refsect2 id="sql-copy-csv-format">
    <title>CSV Format</title>
 
    <para>
@@ -855,7 +855,7 @@
 
   </refsect2>
 
-  <refsect2>
+  <refsect2 id="sql-copy-binary-format">
    <title>Binary Format</title>
 
    <para>
-- 
2.39.2


Re: Doc anchors for COPY formats

От
Daniel Gustafsson
Дата:
> On 25 Apr 2024, at 13:23, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> wrote:

> An IRC conversation just now made me notice that it would be handy to
> have stable links for the descrpitions of the various COPY formats, per
> the attached patch.

No objections, that seems perfectly a reasonable idea.  Maybe we should set an
xreflabel while at it for completeness sake?

--
Daniel Gustafsson




Re: Doc anchors for COPY formats

От
Dagfinn Ilmari Mannsåker
Дата:
Daniel Gustafsson <daniel@yesql.se> writes:

>> On 25 Apr 2024, at 13:23, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> wrote:
>
>> An IRC conversation just now made me notice that it would be handy to
>> have stable links for the descrpitions of the various COPY formats, per
>> the attached patch.
>
> No objections, that seems perfectly a reasonable idea.  Maybe we should set an
> xreflabel while at it for completeness sake?

xreflabel only affects the link text when using <xref>, but there are no
links to these sections in the docs, so I don't see much point.  One
thing that could make sense would be to link to the File Formats section
from the FORMAT keyword docs, like the attached.

- ilmari

From 8921e4b6d86d29210b9d59511def16ba34865f62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Thu, 25 Apr 2024 12:09:14 +0100
Subject: [PATCH v2] Add anchors for COPY format descriptions

And link the section from the FORMAT keyword description.
---
 doc/src/sgml/ref/copy.sgml | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml
index 1ce19668d8..f52ad1e34f 100644
--- a/doc/src/sgml/ref/copy.sgml
+++ b/doc/src/sgml/ref/copy.sgml
@@ -220,6 +220,7 @@
       <literal>csv</literal> (Comma Separated Values),
       or <literal>binary</literal>.
       The default is <literal>text</literal>.
+      See <xref linkend="sql-copy-file-formats"/> below for details.
      </para>
     </listitem>
    </varlistentry>
@@ -627,10 +628,10 @@
 
  </refsect1>
 
- <refsect1>
+ <refsect1 id="sql-copy-file-formats" xreflabel="File Formats">
   <title>File Formats</title>
 
-  <refsect2>
+  <refsect2 id="sql-copy-text-format">
    <title>Text Format</title>
 
    <para>
@@ -770,7 +771,7 @@
    </para>
   </refsect2>
 
-  <refsect2>
+  <refsect2 id="sql-copy-csv-format">
    <title>CSV Format</title>
 
    <para>
@@ -855,7 +856,7 @@
 
   </refsect2>
 
-  <refsect2>
+  <refsect2 id="sql-copy-binary-format">
    <title>Binary Format</title>
 
    <para>
-- 
2.39.2