8000 Merge branch 'master' into 9985_latex_on_master · sphinx-doc/sphinx@cfb5d55 · GitHub
[go: up one dir, main page]

Skip to content

Commit cfb5d55

Browse files
authored
Merge branch 'master' into 9985_latex_on_master
2 parents 9e8e3f9 + 03c9151 commit cfb5d55

File tree

6 files changed

+18
-27
lines changed

6 files changed

+18
-27
lines changed

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Dependencies
99
Incompatible changes
1010
--------------------
1111

12+
* #9962: texinfo: Customizing styles of emphasized text via ``@definfoenclose``
13+
command was not supported because the command was deprecated since texinfo 6.8
1214
* #2068: :confval:`intersphinx_disabled_reftypes` has changed default value
1315
from an empty list to ``['std:doc']`` as avoid too surprising silent
1416
intersphinx resolutions.
@@ -25,6 +27,9 @@ Features added
2527
Bugs fixed
2628
----------
2729

30+
* #9962: texinfo: Deprecation message for ``@definfoenclose`` command on
31+
bulding texinfo document
32+
2833
Testing
2934
--------
3035

doc/faq.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -350,19 +350,3 @@ The following notes may be helpful if you want to create Texinfo files:
350350
scheme ``info``. For example::
351351

352352
info:Texinfo#makeinfo_options
353-
354-
- Inline markup
355-
356-
The standard formatting for ``*strong*`` and ``_emphasis_`` can
357-
result in ambiguous output when used to markup parameter names and
358-
other values. Since this is a fairly common practice, the default
359-
formatting has been changed so that ``emphasis`` and ``strong`` are
360-
now displayed like ```literal'``\s.
361-
362-
The standard formatting can be re-enabled by adding the following to
363-
your :file:`conf.py`::
364-
365-
texinfo_elements = {'preamble': """
366-
@definfoenclose strong,*,*
367-
@definfoenclose emph,_,_
368-
"""}

sphinx/writers/texinfo.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
@exampleindent %(exampleindent)s
5959
@finalout
6060
%(direntry)s
61-
@definfoenclose strong,`,'
62-
@definfoenclose emph,`,'
6361
@c %%**end of header
6462
6563
@copying
@@ -805,17 +803,21 @@ def depart_line(self, node: Element) -> None:
805803
# -- Inline
806804

807805
def visit_strong(self, node: Element) -> None:
808-
self.body.append('@strong{')
806+
self.body.append('`')
809807

810808
def depart_strong(self, node: Element) -> None:
811-
self.body.append('}')
809+
self.body.append("'")
812810

813811
def visit_emphasis(self, node: Element) -> None:
814-
element = 'emph' if not self.in_samp else 'var'
815-
self.body.append('@%s{' % element)
812+
if self.in_samp:
813+
self.body.append('@var{')
814+
self.context.append('}')
815+
else:
816+
self.body.append('`')
817+
self.context.append("'")
816818

817819
def depart_emphasis(self, node: Element) -> None:
818-
self.body.append('}')
820+
self.body.append(self.context.pop())
819821

820822
def is_samp(self, node: Element) -> bool:
821823
return 'samp' in node['classes']

tests/roots/test-glossary/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ test-glossary
1818
über
1919
Gewisse
2020

21-
änhlich
21+
ähnlich
2222
Dinge

tests/roots/test-root/markup.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ This tests :CLASS:`role names in uppercase`.
352352
über
353353
Gewisse
354354

355-
änhlich
355+
ähnlich
356356
Dinge
357357

358358
.. productionlist::

tests/test_build_latex.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,9 +1454,9 @@ def test_latex_glossary(app, status, warning):
14541454
app.builder.build_all()
14551455

14561456
result = (app.outdir / 'python.tex').read_text()
1457-
assert (r'\sphinxlineitem{änhlich\index{änhlich@\spxentry{änhlich}|spxpagem}'
1457+
assert (r'\sphinxlineitem{ähnlich\index{änhlich@\spxentry{ähnlich}|spxpagem}'
14581458
r'\phantomsection'
1459-
r'\label{\detokenize{index:term-anhlich}}}' in result)
1459+
r'\label{\detokenize{index:term-ahnlich}}}' in result)
14601460
assert (r'\sphinxlineitem{boson\index{boson@\spxentry{boson}|spxpagem}\phantomsection'
14611461
r'\label{\detokenize{index:term-boson}}}' in result)
14621462
assert (r'\sphinxlineitem{\sphinxstyleemphasis{fermion}'

0 commit comments

Comments
 (0)
0