SF.net SVN: docutils:[10055 ] trunk

grubert--- via Docutils-checkins <[email protected]> Fri, 21 Mar 2025 02:33:51 +0000
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 10055
          http://sourceforge.net/p/docutils/code/10055
Author:   grubert
Date:     2025-03-21 02:33:48 +0000 (Fri, 21 Mar 2025)
Log Message:
-----------
macro-references: reduce space around refs.

Modified Paths:
--------------
    trunk/docutils/HISTORY.rst
    trunk/docutils/docutils/writers/manpage.py
    trunk/sandbox/manpage-writer/expected/refs-urue.man
    trunk/sandbox/manpage-writer/expected/refs-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/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst	2025-03-21 02:22:45 UTC (rev 10054)
+++ trunk/docutils/HISTORY.rst	2025-03-21 02:33:48 UTC (rev 10055)
@@ -213,6 +213,7 @@
   - Do not output .UR/.UE macros without refuri in node.
   - Use .MT/.ME macros for mailto.uris.
   - macro-references: output refuri always.
+  - macro-references: reduce space around refs.
   - text-references: no line end after refuri, no additional spaces.
   - text-references: Skip references only if content is equal, or only differs
     by "mailto:".

Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py	2025-03-21 02:22:45 UTC (rev 10054)
+++ trunk/docutils/docutils/writers/manpage.py	2025-03-21 02:33:48 UTC (rev 10055)
@@ -1111,8 +1111,10 @@
             self.context.append('')
 
     def _depart_reference_with_macro(self, node) -> None:
-        self.ensure_eol()
-        self.body.append(self.context.pop())
+        macro_end = self.context.pop()
+        if macro_end:
+            self.ensure_eol()
+            self.body.append(macro_end)
     # ----
 
     def visit_revision(self, node) -> None:

Modified: trunk/sandbox/manpage-writer/expected/refs-urue.man
===================================================================
--- trunk/sandbox/manpage-writer/expected/refs-urue.man	2025-03-21 02:22:45 UTC (rev 10054)
+++ trunk/sandbox/manpage-writer/expected/refs-urue.man	2025-03-21 02:33:48 UTC (rev 10055)
@@ -63,12 +63,10 @@
 .IP [3] 5
 a.k.a. 
 third
-
 .IP [4] 5
 a.k.a. 
 fourth
 
-
 .sp
 .ce
 ----
@@ -98,8 +96,7 @@
 .sp
 Given a citation like [this], one
 can also refer to it like 
-this
-\&.
+this\&.
 .IP [this] 5
 here.
 .SS External Hyperlink Targets
@@ -118,8 +115,7 @@
 .SS Internal Hyperlink Targets
 .sp
 Internal cross\-references, like 
-example
-\&.
+example\&.
 .sp
 This is an example cross\-reference target.
 .SS Indirect Hyperlink Targets
@@ -137,8 +133,7 @@
 .sp
 Implicit references, like 
 Titles are
-targets, too
-\&.
+targets, too\&.
 .SH and
 .sp
 See the 

Modified: trunk/sandbox/manpage-writer/expected/refs-urue.utf8
===================================================================
--- trunk/sandbox/manpage-writer/expected/refs-urue.utf8	2025-03-21 02:22:45 UTC (rev 10054)
+++ trunk/sandbox/manpage-writer/expected/refs-urue.utf8	2025-03-21 02:33:48 UTC (rev 10055)
@@ -26,11 +26,9 @@
 
        [3]  a.k.a.  third
 
-
        [4]  a.k.a.  fourth
 
 
-
                                            ----
 
 
@@ -51,7 +49,7 @@
             Citation  labels  contain  alphanumerics,  underlines, hyphens and
             fullstops.  Case is not significant.
 
-            Given a citation like [this], one can also refer to it like this .
+            Given a citation like [this], one can also refer to it like this.
 
        [this]
             here.
@@ -62,7 +60,7 @@
        embedded External hyperlinks, like ]8;;https://www.python.org/\Python]8;;\ .
 
    Internal Hyperlink Targets
-       Internal cross-references, like example .
+       Internal cross-references, like example.
 
        This is an example cross-reference target.
 
@@ -71,7 +69,7 @@
         is ]8;;https://www.python.org/\my favourite programming language]8;;\ .
 
 Titles are targets, too
-       Implicit references, like Titles are targets, too .
+       Implicit references, like Titles are targets, too.
 
 and
        See the ]8;;https://www.python.org/\Python]8;;\

Modified: trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.man
===================================================================
--- trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.man	2025-03-21 02:22:45 UTC (rev 10054)
+++ trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.man	2025-03-21 02:33:48 UTC (rev 10055)
@@ -63,12 +63,10 @@
 .IP [3] 5
 a.k.a. 
 third
-
 .IP [4] 5
 a.k.a. 
 fourth
 
-
 .sp
 .ce
 ----
@@ -98,8 +96,7 @@
 .sp
 Given a citation like [this], one
 can also refer to it like 
-this
-\&.
+this\&.
 .IP [this] 5
 here.
 .SS External Hyperlink Targets
@@ -118,8 +115,7 @@
 .SS Internal Hyperlink Targets
 .sp
 Internal cross\-references, like 
-example
-\&.
+example\&.
 .sp
 This is an example cross\-reference target.
 .SS Indirect Hyperlink Targets
@@ -137,8 +133,7 @@
 .sp
 Implicit references, like 
 Titles are
-targets, too
-\&.
+targets, too\&.
 .SH and
 .sp
 See the 

Modified: trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.ps
===================================================================
--- trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.ps	2025-03-21 02:22:45 UTC (rev 10054)
+++ trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.ps	2025-03-21 02:33:48 UTC (rev 10055)
@@ -103,11 +103,11 @@
 87.274 349.041([3])s
 114.774(a.k.a.)c
 143.792(third)c
-87.274 302.874([4])s
+87.274 318.263([4])s
 114.774(a.k.a.)c
 143.792(fourth)c
-322.190 241.318(----)s
-114.774 164.373(Auto-symbol)s
+322.190 272.096(----)s
+114.774 195.151(Auto-symbol)s
 175.582(footnotes)c
 219.274(are)c
 235.455(also)c
@@ -117,13 +117,18 @@
 338.437([*])c
 354.013(and)c
 372.647([<*>].)c
-87.274 133.595([*])s
+87.274 164.373([*])s
 114.774(This)c
 137.082(is)c
 147.169(the)c
 163.361(first)c
 183.832(one.)c
-87.274 102.817([<*>])s
+87.274 133.595([<*>])s
+114.774 118.206(This)s
+137.082(is)c
+147.169(the)c
+163.361(second)c
+196.658(one.)c
 f0
 68.024 739.233(\(\))s
 536.932(\(\))c
@@ -130,16 +135,10 @@
 536.932 36.245(\(\))s
 showpage
 %%Page: 2 2
-f0
-114.774 702.988(This)s
-137.082(is)c
-147.169(the)c
-163.361(second)c
-196.658(one.)c
 f1
-76.274 672.210(Citations)s
+76.274 702.988(Citations)s
 f0
-87.274 656.821(Citation)s
+87.274 687.599(Citation)s
 125.477(references,)c
 176.165(like)c
 195.415([CIT2002].)c
@@ -155,9 +154,9 @@
 473.418(bottom)c
 507.342(of)c
 519.255(the)c
-87.274 641.432("page".)s
-87.274 610.654([CIT2002])s
-114.774 595.265(A)s
+87.274 672.210("page".)s
+87.274 641.432([CIT2002])s
+114.774 626.043(A)s
 125.466(citation)c
 161.216(\(as)c
 176.792(often)c
@@ -164,7 +163,7 @@
 202.147(used)c
 225.060(in)c
 236.368(journals\).)c
-114.774 564.487(Citation)s
+114.774 595.265(Citation)s
 152.977(labels)c
 181.390(contain)c
 216.524(alphanumerics,)c
@@ -176,7 +175,7 @@
 465.828(is)c
 475.915(not)c
 492.723(significant.)c
-114.774 533.709(Given)s
+114.774 564.487(Given)s
 144.408(a)c
 152.042(citation)c
 187.792(like)c
@@ -188,22 +187,21 @@
 316.393(to)c
 327.701(it)c
 336.567(like)c
-355.817(this)c
-374.462(.)c
-87.274 502.931([this])s
+355.817(this.)c
+87.274 533.709([this])s
 114.774(here.)c
 f1
-76.274 472.153(External)s
+76.274 502.931(External)s
 119.966(Hyperlink)c
 171.006(Targets)c
 f0
-87.274 456.764(External)s
+87.274 487.542(External)s
 127.292(hyperlinks,)c
 179.234(like)c
 198.484(Python)c
 232.408(<https://www.python.org/>)c
 355.740(.)c
-87.274 425.986(embedded)s
+87.274 456.764(embedded)s
 135.234(External)c
 175.252(hyperlinks,)c
 227.194(like)c
@@ -211,16 +209,15 @@
 280.368(<https://www.python.org/>)c
 403.700(.)c
 f1
-76.274 395.208(Internal)s
+76.274 425.986(Internal)s
 117.524(Hyperlink)c
 168.564(Targets)c
 f0
-87.274 379.819(Internal)s
+87.274 410.597(Internal)s
 124.234(cross-references,)c
 201.190(like)c
-220.440(example)c
-260.458(.)c
-87.274 349.041(This)s
+220.440(example.)c
+87.274 379.819(This)s
 109.582(is)c
 119.669(an)c
 132.803(example)c
@@ -227,13 +224,13 @@
 172.821(cross-reference)c
 242.748(target.)c
 f1
-76.274 318.263(Indirect)s
+76.274 349.041(Indirect)s
 116.908(Hyperlink)c
 167.948(Targets)c
 f0
-87.274 302.874(Python)s
+87.274 333.652(Python)s
 121.198(<https://www.python.org/>)c
-90.024 287.485(is)s
+90.024 318.263(is)s
 100.111(my)c
 116.919(favourite)c
 159.379(programming)c
@@ -241,43 +238,45 @@
 264.473(<https://www.python.org/>)c
 387.805(.)c
 f1
-68.024 256.707(Titles)s
+68.024 287.485(Titles)s
 97.053(are)c
 115.071(targets,)c
 152.944(too)c
 f0
-87.274 241.318(Implicit)s
+87.274 272.096(Implicit)s
 124.861(references,)c
 175.549(like)c
 194.799(Titles)c
 222.607(are)c
 238.788(targets,)c
-273.614(too)c
-290.422(.)c
+273.614(too.)c
 f1
-68.024 210.540(and)s
+68.024 241.318(and)s
 f0
-87.274 195.151(See)s
+87.274 225.929(See)s
 105.908(the)c
 122.100(Python)c
 156.024(<https://www.python.org/>)c
-90.024 179.762(home)s
+90.024 210.540(home)s
 117.216(page)c
 140.734(for)c
 156.310(info.)c
-87.274 148.984(Write)s
+87.274 179.762(Write)s
 115.071(to)c
 126.379(me)c
 142.571(<mailto:[email protected]>)c
-90.024 133.595(with)s
+90.024 164.373(with)s
 112.332(your)c
 135.245(questions.)c
 f1
-76.274 102.817(URIs)s
+76.274 133.595(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
+187.275(<tel:+48-816-555-1212>)c
+f0
 68.024 739.233(\(\))s
 536.932(\(\))c
 536.932 36.245(\(\))s
@@ -284,20 +283,18 @@
 showpage
 %%Page: 3 3
 f0
-87.274 702.988(tel:+48-816-555-1212)s
-187.275(<tel:+48-816-555-1212>)c
-87.274 672.210(urn:isbn:0-486-27557-4)s
+87.274 702.988(urn:isbn:0-486-27557-4)s
 195.129(<urn:isbn:0-486-27557-4>)c
-87.274 641.432(news:comp.infosystems.www.servers.unix)s
+87.274 672.210(news:comp.infosystems.www.servers.unix)s
 278.223(<news:comp.infosystems.www.servers.unix>)c
-87.274 610.654(https://[email protected]:123/forum/questions/?tag=networking&order=newest#top)s
-87.274 595.265(<https://[email protected]:123/forum/questions/?tag=networking&order=newest#top>)s
+87.274 641.432(https://[email protected]:123/forum/questions/?tag=networking&order=newest#top)s
+87.274 626.043(<https://[email protected]:123/forum/questions/?tag=networking&order=newest#top>)s
 f1
-76.274 549.098(Standalone)s
+76.274 579.876(Standalone)s
 131.593(email)c
 160.006(addresses)c
 f0
-87.274 533.709(like)s
+87.274 564.487(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-03-21 02:22:45 UTC (rev 10054)
+++ trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.utf8	2025-03-21 02:33:48 UTC (rev 10055)
@@ -27,11 +27,9 @@
 
        [3]  a.k.a.  third
 
-
        [4]  a.k.a.  fourth
 
 
-
                                            ----
 
 
@@ -53,7 +51,7 @@
             Citation labels contain alphanumerics, underlines, hyphens and
             fullstops.  Case is not significant.
 
-            Given a citation like [this], one can also refer to it like this .
+            Given a citation like [this], one can also refer to it like this.
 
        [this]
             here.
@@ -64,7 +62,7 @@
        embedded External hyperlinks, like Python <https://www.python.org/> .
 
    IInntteerrnnaall HHyyppeerrlliinnkk TTaarrggeettss
-       Internal cross-references, like example .
+       Internal cross-references, like example.
 
        This is an example cross-reference target.
 
@@ -73,7 +71,7 @@
         is my favourite programming language <https://www.python.org/> .
 
 TTiittlleess aarree ttaarrggeettss,, ttoooo
-       Implicit references, like Titles are targets, too .
+       Implicit references, like Titles are targets, too.
 
 aanndd
        See the Python <https://www.python.org/>

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