SF.net SVN: docutils:[9755] trunk/docutils/docutils/transforms/ references.py

milde--- via Docutils-checkins <[email protected]>
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 9755
          http://sourceforge.net/p/docutils/code/9755
Author:   milde
Date:     2024-06-14 15:03:12 +0000 (Fri, 14 Jun 2024)
Log Message:
-----------
Fix attribute names in transforms.references docstring examples.

Fixup for [r3916] (2005-10-02).

Modified Paths:
--------------
    trunk/docutils/docutils/transforms/references.py

Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py	2024-06-14 11:05:04 UTC (rev 9754)
+++ trunk/docutils/docutils/transforms/references.py	2024-06-14 15:03:12 UTC (rev 9755)
@@ -159,12 +159,12 @@
     a) Indirect external references::
 
            <paragraph>
-               <reference refname="indirect external">
+               <reference refname="indirect-external">
                    indirect external
-           <target id="id1" name="direct external"
+           <target ids="id1" names="direct-external"
                refuri="http://indirect">
-           <target id="id2" name="indirect external"
-               refname="direct external">
+           <target ids="id2" names="indirect-external"
+               refname="direct-external">
 
        The "refuri" attribute is migrated back to all indirect targets
        from the final direct target (i.e. a target not referring to
@@ -171,11 +171,11 @@
        another indirect target)::
 
            <paragraph>
-               <reference refname="indirect external">
+               <reference refname="indirect-external">
                    indirect external
-           <target id="id1" name="direct external"
+           <target ids="id1" names="direct-external"
                refuri="http://indirect">
-           <target id="id2" name="indirect external"
+           <target ids="id2" names="indirect-external"
                refuri="http://indirect">
 
        Once the attribute is migrated, the preexisting "refname" attribute
@@ -183,14 +183,14 @@
 
     b) Indirect internal references::
 
-           <target id="id1" name="final target">
+           <target ids="id1" names="final-target">
            <paragraph>
-               <reference refname="indirect internal">
+               <reference refname="indirect-internal">
                    indirect internal
-           <target id="id2" name="indirect internal 2"
+           <target ids="id2" names="indirect-internal-2"
                refname="final target">
-           <target id="id3" name="indirect internal"
-               refname="indirect internal 2">
+           <target ids="id3" names="indirect-internal"
+               refname="indirect-internal-2">
 
        Targets which indirectly refer to an internal target become one-hop
        indirect (their "refid" attributes are directly set to the internal
@@ -197,12 +197,12 @@
        target's "id"). References which indirectly refer to an internal
        target become direct internal references::
 
-           <target id="id1" name="final target">
+           <target ids="id1" names="final-target">
            <paragraph>
                <reference refid="id1">
                    indirect internal
-           <target id="id2" name="indirect internal 2" refid="id1">
-           <target id="id3" name="indirect internal" refid="id1">
+           <target ids="id2" names="indirect-internal-2" refid="id1">
+           <target ids="id3" names="indirect-internal" refid="id1">
     """
 
     default_priority = 460
@@ -336,9 +336,9 @@
     Given::
 
         <paragraph>
-            <reference refname="direct external">
+            <reference refname="direct-external">
                 direct external
-        <target id="id1" name="direct external" refuri="http://direct">
+        <target ids="id1" names="direct-external" refuri="http://direct">
 
     The "refname" attribute is replaced by the direct "refuri" attribute::
 
@@ -345,7 +345,7 @@
         <paragraph>
             <reference refuri="http://direct">
                 direct external
-        <target id="id1" name="direct external" refuri="http://direct">
+        <target ids="id1" names="direct-external" refuri="http://direct">
     """
 
     default_priority = 640
@@ -380,9 +380,9 @@
         Given::
 
             <paragraph>
-                <reference refname="direct internal">
+                <reference refname="direct-internal">
                     direct internal
-            <target id="id1" name="direct internal">
+            <target ids="id1" names="direct-internal">
 
         The "refname" attribute is replaced by "refid" linking to the target's
         "id"::
@@ -390,7 +390,7 @@
             <paragraph>
                 <reference refid="id1">
                     direct internal
-            <target id="id1" name="direct internal">
+            <target ids="id1" names="direct-internal">
         """
         for name in target['names']:
             refid = self.document.nameids.get(name)
@@ -417,14 +417,14 @@
         <document>
             <paragraph>
                 A labeled autonumbered footnote reference:
-                <footnote_reference auto="1" id="id1" refname="footnote">
+                <footnote_reference auto="1" ids="id1" refname="footnote">
             <paragraph>
                 An unlabeled autonumbered footnote reference:
-                <footnote_reference auto="1" id="id2">
-            <footnote auto="1" id="id3">
+                <footnote_reference auto="1" ids="id2">
+            <footnote auto="1" ids="id3">
                 <paragraph>
                     Unlabeled autonumbered footnote.
-            <footnote auto="1" id="footnote" name="footnote">
+            <footnote auto="1" ids="footnote" names="footnote">
                 <paragraph>
                     Labeled autonumbered footnote.
 
@@ -439,18 +439,18 @@
         <document>
             <paragraph>
                 A labeled autonumbered footnote reference:
-                <footnote_reference auto="1" id="id1" refid="footnote">
+                <footnote_reference auto="1" ids="id1" refid="footnote">
                     2
             <paragraph>
                 An unlabeled autonumbered footnote reference:
-                <footnote_reference auto="1" id="id2" refid="id3">
+                <footnote_reference auto="1" ids="id2" refid="id3">
                     1
-            <footnote auto="1" id="id3" backrefs="id2">
+            <footnote auto="1" ids="id3" backrefs="id2">
                 <label>
                     1
                 <paragraph>
                     Unlabeled autonumbered footnote.
-            <footnote auto="1" id="footnote" name="footnote" backrefs="id1">
+            <footnote auto="1" ids="footnote" names="footnote" backrefs="id1">
                 <label>
                     2
                 <paragraph>
@@ -641,7 +641,7 @@
                 <substitution_reference refname="biohazard">
                     biohazard
                  symbol is deservedly scary-looking.
-            <substitution_definition name="biohazard">
+            <substitution_definition names="biohazard">
                 <image alt="biohazard" uri="biohazard.png">
 
     The ``substitution_reference`` will simply be replaced by the
@@ -654,7 +654,7 @@
                 The
                 <image alt="biohazard" uri="biohazard.png">
                  symbol is deservedly scary-looking.
-            <substitution_definition name="biohazard">
+            <substitution_definition names="biohazard">
                 <image alt="biohazard" uri="biohazard.png">
     """
 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.