Skip to contentSkip to conversation

docs: fix broken reference

PATCH Applied John Snow 3 participants 4 messages May 11, 2021 – Jun 5, 2021

lore
Share & tools
lore

John Snow

author
#0 lore raw

PATCH 1/1 docs: fix broken reference

Long story short, we need a space here for the reference to work correctly.

Longer story:

Without the space, kerneldoc generates a line like this:

one of :c:type:MemoryListener.region_add\(\) <MemoryListener>,:c:type:`MemoryListener.region_del\(\)

Sphinx does not process the role information correctly, so we get this (my pseudo-notation) construct:

<text>,:c:type:</text>
<reference target="MemoryListener">MemoryListener.region_del()</reference>

which does not reference the desired entity, and leaves some extra junk in the rendered output. See
https://qemu-project.gitlab.io/qemu/devel/memory.html#c.MemoryListener
member log_start for an example of the broken output as it looks today.

---
 include/exec/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/memory.h +1 -1
index 5728a681b27..3b9ca696061 100644
@@ -571,7 +571,7 @@ struct MemoryListener {
      * @log_start:
      *
      * Called during an address space update transaction, after
-     * one of #MemoryListener.region_add(),#MemoryListener.region_del() or
+     * one of #MemoryListener.region_add(), #MemoryListener.region_del() or
      * #MemoryListener.region_nop(), if dirty memory logging clients have
      * become active since the last transaction.
      *
Signature · 1 line
2.30.2
author
#1 lore raw

ping

Quoted 40 lines · John Snow

Long story short, we need a space here for the reference to work correctly.

Longer story:

Without the space, kerneldoc generates a line like this:

one of :c:type:MemoryListener.region_add\(\) <MemoryListener>,:c:type:`MemoryListener.region_del\(\)

Sphinx does not process the role information correctly, so we get this (my pseudo-notation) construct:

<text>,:c:type:</text>
<reference target="MemoryListener">MemoryListener.region_del()</reference>

which does not reference the desired entity, and leaves some extra junk in the rendered output. See
https://qemu-project.gitlab.io/qemu/devel/memory.html#c.MemoryListener
member log_start for an example of the broken output as it looks today.

---
  include/exec/memory.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/memory.h +1 -1
index 5728a681b27..3b9ca696061 100644
@@ -571,7 +571,7 @@ struct MemoryListener {
       * @log_start:
       *
       * Called during an address space update transaction, after
-     * one of #MemoryListener.region_add(),#MemoryListener.region_del() or
+     * one of #MemoryListener.region_add(), #MemoryListener.region_del() or
       * #MemoryListener.region_nop(), if dirty memory logging clients have
       * become active since the last transaction.
       *
Reviewed-by on v1 1/1
#2 lore raw
In reply to John Snow
Quoted 32 lines · John Snow

Long story short, we need a space here for the reference to work correctly.

Longer story:

Without the space, kerneldoc generates a line like this:

one of :c:type:MemoryListener.region_add\(\) <MemoryListener>,:c:type:`MemoryListener.region_del\(\)

Sphinx does not process the role information correctly, so we get this (my pseudo-notation) construct:

<text>,:c:type:</text>
<reference target="MemoryListener">MemoryListener.region_del()</reference>

which does not reference the desired entity, and leaves some extra junk in the rendered output. See
https://qemu-project.gitlab.io/qemu/devel/memory.html#c.MemoryListener
member log_start for an example of the broken output as it looks today.

---
 include/exec/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/memory.h +0 -0
index 5728a681b27..3b9ca696061 100644

include/exec/memory.h struct MemoryListener {

Quoted 9 lines
include/exec/memory.h +1 -2
@@ -571,7 +571,7 @@ struct MemoryListener {
      * @log_start:
      *
      * Called during an address space update transaction, after
-     * one of #MemoryListener.region_add(),#MemoryListener.region_del() or
+     * one of #MemoryListener.region_add(), #MemoryListener.region_del() or
      * #MemoryListener.region_nop(), if dirty memory logging clients have
      * become active since the last transaction.
      *
--

thanks
-- PMM

#3 lore raw
In reply to John Snow

Le 11/05/2021 à 21:29, John Snow a écrit :

Quoted 32 lines

Long story short, we need a space here for the reference to work correctly.

Longer story:

Without the space, kerneldoc generates a line like this:

one of :c:type:MemoryListener.region_add\(\) <MemoryListener>,:c:type:`MemoryListener.region_del\(\)

Sphinx does not process the role information correctly, so we get this (my pseudo-notation) construct:

<text>,:c:type:</text>
<reference target="MemoryListener">MemoryListener.region_del()</reference>

which does not reference the desired entity, and leaves some extra junk in the rendered output. See
https://qemu-project.gitlab.io/qemu/devel/memory.html#c.MemoryListener
member log_start for an example of the broken output as it looks today.

---
 include/exec/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/memory.h +0 -0
index 5728a681b27..3b9ca696061 100644

include/exec/memory.h struct MemoryListener { · line 577

Quoted 8 lines
include/exec/memory.h +1 -1
@@ -571,7 +571,7 @@ struct MemoryListener {
      * @log_start:
      *
      * Called during an address space update transaction, after
-     * one of #MemoryListener.region_add(),#MemoryListener.region_del() or
+     * one of #MemoryListener.region_add(), #MemoryListener.region_del() or
      * #MemoryListener.region_nop(), if dirty memory logging clients have
      * become active since the last transaction.
      *

Applied to my trivial-patches branch.

Thanks,
Laurent