SF.net SVN: docutils:[10073 ] trunk

grubert--- via Docutils-checkins <[email protected]> Thu, 03 Apr 2025 17:33:39 +0000
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 10073
          http://sourceforge.net/p/docutils/code/10073
Author:   grubert
Date:     2025-04-03 17:33:39 +0000 (Thu, 03 Apr 2025)
Log Message:
-----------
simplfy reference tail handling

Modified Paths:
--------------
    trunk/docutils/docutils/writers/manpage.py
    trunk/sandbox/manpage-writer/expected/ref-2025-urue.man
    trunk/sandbox/manpage-writer/expected/ref-2025-urue.utf8
    trunk/sandbox/manpage-writer/expected/refs-urue.man
    trunk/sandbox/manpage-writer/expected/refs-urue.utf8
    trunk/sandbox/manpage-writer/expected-mandoc/ref-2025-urue.utf8
    trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.man
    trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.ps
    trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.utf8

Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py	2025-04-03 17:09:10 UTC (rev 10072)
+++ trunk/docutils/docutils/writers/manpage.py	2025-04-03 17:33:39 UTC (rev 10073)
@@ -355,18 +355,8 @@
                 if self.body[i+1][0] in ('\n', '\r'):
                     self.body[i+1] = '.' + self.body[i+1]
                 # b) with a separator: move the 1st char to current item
-                elif self.body[i+1][0] in ')]}>,':
-                    self.body[i] = "%s %s\\c\n" % (
-                            self.body[i][:3], self.body[i+1][0])
-                    self.body[i+1] = self.body[i+1][1:]
-                    if self.body[i+1].startswith('.'):
-                        self.body[i+1] = '\\&' + self.body[i+1]
-                    # TODO blank line to ".\n" see a)
-                    # INWORK next line starts with escaped "."
-                elif self.body[i+1][:3] == r'\&.':
-                    self.body[i] = "%s .\\c\n" % ( self.body[i][:3])
-                    self.body[i+1] = self.body[i+1][3:]
-                    # TODO blank line to ".\n" see a)
+                else:
+                    self.body[i] = "%s \\c\n" % ( self.body[i][:3])
         return ''.join(self.head + self.body + self.foot)
 
     def deunicode(self, text):

Modified: trunk/sandbox/manpage-writer/expected/ref-2025-urue.man
===================================================================
--- trunk/sandbox/manpage-writer/expected/ref-2025-urue.man	2025-04-03 17:09:10 UTC (rev 10072)
+++ trunk/sandbox/manpage-writer/expected/ref-2025-urue.man	2025-04-03 17:33:39 UTC (rev 10073)
@@ -36,16 +36,16 @@
 Aaaaa (\c
 .MT mailto:[email protected]
 [email protected]
-.ME )\c
-,
+.ME \c
+),
 .UR https://github.com/cc
 Bbb
-.UE
+.UE \c
  (\c
 .MT mailto:[email protected]
 [email protected]
-.ME )\c
-\&.
+.ME \c
+).
 .UR https://github.com/m
 mm
 .UE
@@ -57,6 +57,6 @@
 and \c
 .UR https://github.com/OooOoooo
 OooOoooo
-.UE .\c
-
+.UE \c
+\&.
 .\" End of generated man page.

Modified: trunk/sandbox/manpage-writer/expected/ref-2025-urue.utf8
===================================================================
--- trunk/sandbox/manpage-writer/expected/ref-2025-urue.utf8	2025-04-03 17:09:10 UTC (rev 10072)
+++ trunk/sandbox/manpage-writer/expected/ref-2025-urue.utf8	2025-04-03 17:33:39 UTC (rev 10073)
@@ -1,7 +1,6 @@
 ()                                                                          ()
 
 Name
-        - Aaaaa (]8;;mailto:mailto:[email protected]\[email protected]]8;;\), ]8;;https://github.com/cc\Bbb]8;;\
-        (]8;;mailto:mailto:[email protected]\[email protected]]8;;\).  ]8;;https://github.com/m\mm]8;;\ ]8;;https://github.com/nn\nn]8;;\ and ]8;;https://github.com/OooOoooo\OooOoooo]8;;\.
+        - Aaaaa (]8;;mailto:mailto:[email protected]\[email protected]]8;;\), ]8;;https://github.com/cc\Bbb]8;;\ (]8;;mailto:mailto:[email protected]\[email protected]]8;;\).  ]8;;https://github.com/m\mm]8;;\ ]8;;https://github.com/nn\nn]8;;\ and ]8;;https://github.com/OooOoooo\OooOoooo]8;;\.
 
                                                                             ()

Modified: trunk/sandbox/manpage-writer/expected/refs-urue.man
===================================================================
--- trunk/sandbox/manpage-writer/expected/refs-urue.man	2025-04-03 17:09:10 UTC (rev 10072)
+++ trunk/sandbox/manpage-writer/expected/refs-urue.man	2025-04-03 17:33:39 UTC (rev 10073)
@@ -101,14 +101,14 @@
 External hyperlinks, like \c
 .UR https://www.python.org/
 Python
-.UE .\c
-
+.UE \c
+\&.
 .sp
 embedded External hyperlinks, like \c
 .UR https://www.python.org/
 Python
-.UE .\c
-
+.UE \c
+\&.
 .SS Internal Hyperlink Targets
 .sp
 Internal cross\-references, like example\&.
@@ -118,13 +118,13 @@
 .sp
 .UR https://www.python.org/
 Python
-.UE
+.UE \c
  is \c
 .UR https://www.python.org/
 my favourite
 programming language
-.UE .\c
-
+.UE \c
+\&.
 .SH Titles are targets, too
 .sp
 Implicit references, like Titles are
@@ -134,12 +134,12 @@
 See the \c
 .UR https://www.python.org/
 Python
-.UE
+.UE \c
  home page for info.
 .sp
 .MT mailto:[email protected]
 Write to me
-.ME
+.ME \c
  with your questions.
 .\" deduplicate _Python: https://www.python.org
 .

Modified: trunk/sandbox/manpage-writer/expected/refs-urue.utf8
===================================================================
--- trunk/sandbox/manpage-writer/expected/refs-urue.utf8	2025-04-03 17:09:10 UTC (rev 10072)
+++ trunk/sandbox/manpage-writer/expected/refs-urue.utf8	2025-04-03 17:33:39 UTC (rev 10073)
@@ -65,18 +65,15 @@
        This is an example cross-reference target.
 
    Indirect Hyperlink Targets
-       ]8;;https://www.python.org/\Python]8;;\
-        is ]8;;https://www.python.org/\my favourite programming language]8;;\.
+       ]8;;https://www.python.org/\Python]8;;\ is ]8;;https://www.python.org/\my favourite programming language]8;;\.
 
 Titles are targets, too
        Implicit references, like Titles are targets, too.
 
 and
-       See the ]8;;https://www.python.org/\Python]8;;\
-        home page for info.
+       See the ]8;;https://www.python.org/\Python]8;;\ home page for info.
 
-       ]8;;mailto:mailto:[email protected]\Write to me]8;;\
-        with your questions.
+       ]8;;mailto:mailto:[email protected]\Write to me]8;;\ with your questions.
 
    URIs with known schemes
        ]8;;tel:+48-816-555-1212\tel:+48-816-555-1212]8;;\     ]8;;urn:isbn:0-486-27557-4\urn:isbn:0-486-27557-4]8;;\      ]8;;news:comp.infosystems.www.servers.unix\news:comp.infosys‐

Modified: trunk/sandbox/manpage-writer/expected-mandoc/ref-2025-urue.utf8
===================================================================
--- trunk/sandbox/manpage-writer/expected-mandoc/ref-2025-urue.utf8	2025-04-03 17:09:10 UTC (rev 10072)
+++ trunk/sandbox/manpage-writer/expected-mandoc/ref-2025-urue.utf8	2025-04-03 17:33:39 UTC (rev 10073)
@@ -2,7 +2,7 @@
 
 NNaammee
         - Aaaaa ([email protected] <mailto:[email protected]>), Bbb <https://github.com/cc>
-        ([email protected] <mailto:[email protected]>).  mm <https://github.com/m> nn
+       ([email protected] <mailto:[email protected]>).  mm <https://github.com/m> nn
        <https://github.com/nn> and OooOoooo <https://github.com/OooOoooo>.
 
                                                                             ()

Modified: trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.man
===================================================================
--- trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.man	2025-04-03 17:09:10 UTC (rev 10072)
+++ trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.man	2025-04-03 17:33:39 UTC (rev 10073)
@@ -101,14 +101,14 @@
 External hyperlinks, like \c
 .UR https://www.python.org/
 Python
-.UE .\c
-
+.UE \c
+\&.
 .sp
 embedded External hyperlinks, like \c
 .UR https://www.python.org/
 Python
-.UE .\c
-
+.UE \c
+\&.
 .SS Internal Hyperlink Targets
 .sp
 Internal cross\-references, like example\&.
@@ -118,13 +118,13 @@
 .sp
 .UR https://www.python.org/
 Python
-.UE
+.UE \c
  is \c
 .UR https://www.python.org/
 my favourite
 programming language
-.UE .\c
-
+.UE \c
+\&.
 .SH Titles are targets, too
 .sp
 Implicit references, like Titles are
@@ -134,12 +134,12 @@
 See the \c
 .UR https://www.python.org/
 Python
-.UE
+.UE \c
  home page for info.
 .sp
 .MT mailto:[email protected]
 Write to me
-.ME
+.ME \c
  with your questions.
 .\" deduplicate _Python: https://www.python.org
 .

Modified: trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.ps
===================================================================
--- trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.ps	2025-04-03 17:09:10 UTC (rev 10072)
+++ trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.ps	2025-04-03 17:33:39 UTC (rev 10073)
@@ -228,19 +228,19 @@
 f0
 87.274 333.652(Python)s
 121.198(<https://www.python.org/>)c
-90.024 318.263(is)s
-100.111(my)c
-116.919(favourite)c
-159.379(programming)c
-222.013(language)c
-264.473(<https://www.python.org/>.)c
+244.530(is)c
+254.617(my)c
+271.425(favourite)c
+313.885(programming)c
+376.519(language)c
+418.979(<https://www.python.org/>.)c
 f1
-68.024 287.485(Titles)s
+68.024 302.874(Titles)s
 97.053(are)c
 115.071(targets,)c
 152.944(too)c
 f0
-87.274 272.096(Implicit)s
+87.274 287.485(Implicit)s
 124.861(references,)c
 175.549(like)c
 194.799(Titles)c
@@ -248,35 +248,37 @@
 238.788(targets,)c
 273.614(too.)c
 f1
-68.024 241.318(and)s
+68.024 256.707(and)s
 f0
-87.274 225.929(See)s
+87.274 241.318(See)s
 105.908(the)c
 122.100(Python)c
 156.024(<https://www.python.org/>)c
-90.024 210.540(home)s
-117.216(page)c
-140.734(for)c
-156.310(info.)c
-87.274 179.762(Write)s
+279.356(home)c
+306.548(page)c
+330.066(for)c
+345.642(info.)c
+87.274 210.540(Write)s
 115.071(to)c
 126.379(me)c
 142.571(<mailto:[email protected]>)c
-90.024 164.373(with)s
-112.332(your)c
-135.245(questions.)c
+276.936(with)c
+299.244(your)c
+322.157(questions.)c
 f1
-76.274 133.595(URIs)s
+76.274 179.762(URIs)s
 103.466(with)c
 126.995(known)c
 161.535(schemes)c
 f0
-87.274 118.206(tel:+48-816-555-1212)s
+87.274 164.373(tel:+48-816-555-1212)s
 187.275(<tel:+48-816-555-1212>)c
 299.684(urn:isbn:0-486-27557-4)c
 407.539(<urn:isbn:0-486-27557-4>)c
-87.274 102.817(news:comp.infosystems.www.servers.unix)s
+87.274 148.984(news:comp.infosystems.www.servers.unix)s
 278.223(<news:comp.infosystems.www.servers.unix>)c
+87.274 133.595(https://[email protected]:123/forum/questions/?tag=networking&order=newest#top)s
+87.274 118.206(<https://[email protected]:123/forum/questions/?tag=networking&order=newest#top>)s
 f0
 68.024 739.233(\(\))s
 536.932(\(\))c
@@ -283,15 +285,12 @@
 536.932 36.245(\(\))s
 showpage
 %%Page: 3 3
-f0
-87.274 702.988(https://[email protected]:123/forum/questions/?tag=networking&order=newest#top)s
-87.274 687.599(<https://[email protected]:123/forum/questions/?tag=networking&order=newest#top>)s
 f1
-76.274 656.821(Standalone)s
+76.274 702.988(Standalone)s
 131.593(email)c
 160.006(addresses)c
 f0
-87.274 641.432(like)s
+87.274 687.599(like)s
 106.524([email protected])c
 230.296(<mailto:[email protected]>)c
 f0

Modified: trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.utf8
===================================================================
--- trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.utf8	2025-04-03 17:09:10 UTC (rev 10072)
+++ trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.utf8	2025-04-03 17:33:39 UTC (rev 10073)
@@ -67,18 +67,16 @@
        This is an example cross-reference target.
 
    IInnddiirreecctt HHyyppeerrlliinnkk TTaarrggeettss
-       Python <https://www.python.org/>
-        is my favourite programming language <https://www.python.org/>.
+       Python <https://www.python.org/> is my favourite programming language
+       <https://www.python.org/>.
 
 TTiittlleess aarree ttaarrggeettss,, ttoooo
        Implicit references, like Titles are targets, too.
 
 aanndd
-       See the Python <https://www.python.org/>
-        home page for info.
+       See the Python <https://www.python.org/> home page for info.
 
-       Write to me <mailto:[email protected]>
-        with your questions.
+       Write to me <mailto:[email protected]> with your questions.
 
    UURRIIss wwiitthh kknnoowwnn sscchheemmeess
        tel:+48-816-555-1212 <tel:+48-816-555-1212> urn:isbn:0-486-27557-4

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



_______________________________________________
Docutils-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-checkins