mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #9991 from tk0miya/9962_texinfo_definfoenclose
Fix #9962: texinfo: Do not use @definfoenclose to empasize string
This commit is contained in:
commit
03c915174e
5
CHANGES
5
CHANGES
@ -9,6 +9,8 @@ Dependencies
|
|||||||
Incompatible changes
|
Incompatible changes
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
* #9962: texinfo: Customizing styles of emphasized text via ``@definfoenclose``
|
||||||
|
command was not supported because the command was deprecated since texinfo 6.8
|
||||||
* #2068: :confval:`intersphinx_disabled_reftypes` has changed default value
|
* #2068: :confval:`intersphinx_disabled_reftypes` has changed default value
|
||||||
from an empty list to ``['std:doc']`` as avoid too surprising silent
|
from an empty list to ``['std:doc']`` as avoid too surprising silent
|
||||||
intersphinx resolutions.
|
intersphinx resolutions.
|
||||||
@ -25,6 +27,9 @@ Features added
|
|||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
* #9962: texinfo: Deprecation message for ``@definfoenclose`` command on
|
||||||
|
bulding texinfo document
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
16
doc/faq.rst
16
doc/faq.rst
@ -350,19 +350,3 @@ The following notes may be helpful if you want to create Texinfo files:
|
|||||||
scheme ``info``. For example::
|
scheme ``info``. For example::
|
||||||
|
|
||||||
info:Texinfo#makeinfo_options
|
info:Texinfo#makeinfo_options
|
||||||
|
|
||||||
- Inline markup
|
|
||||||
|
|
||||||
The standard formatting for ``*strong*`` and ``_emphasis_`` can
|
|
||||||
result in ambiguous output when used to markup parameter names and
|
|
||||||
other values. Since this is a fairly common practice, the default
|
|
||||||
formatting has been changed so that ``emphasis`` and ``strong`` are
|
|
||||||
now displayed like ```literal'``\s.
|
|
||||||
|
|
||||||
The standard formatting can be re-enabled by adding the following to
|
|
||||||
your :file:`conf.py`::
|
|
||||||
|
|
||||||
texinfo_elements = {'preamble': """
|
|
||||||
@definfoenclose strong,*,*
|
|
||||||
@definfoenclose emph,_,_
|
|
||||||
"""}
|
|
||||||
|
@ -58,8 +58,6 @@ TEMPLATE = """\
|
|||||||
@exampleindent %(exampleindent)s
|
@exampleindent %(exampleindent)s
|
||||||
@finalout
|
@finalout
|
||||||
%(direntry)s
|
%(direntry)s
|
||||||
@definfoenclose strong,`,'
|
|
||||||
@definfoenclose emph,`,'
|
|
||||||
@c %%**end of header
|
@c %%**end of header
|
||||||
|
|
||||||
@copying
|
@copying
|
||||||
@ -805,17 +803,21 @@ class TexinfoTranslator(SphinxTranslator):
|
|||||||
# -- Inline
|
# -- Inline
|
||||||
|
|
||||||
def visit_strong(self, node: Element) -> None:
|
def visit_strong(self, node: Element) -> None:
|
||||||
self.body.append('@strong{')
|
self.body.append('`')
|
||||||
|
|
||||||
def depart_strong(self, node: Element) -> None:
|
def depart_strong(self, node: Element) -> None:
|
||||||
self.body.append('}')
|
self.body.append("'")
|
||||||
|
|
||||||
def visit_emphasis(self, node: Element) -> None:
|
def visit_emphasis(self, node: Element) -> None:
|
||||||
element = 'emph' if not self.in_samp else 'var'
|
if self.in_samp:
|
||||||
self.body.append('@%s{' % element)
|
self.body.append('@var{')
|
||||||
|
self.context.append('}')
|
||||||
|
else:
|
||||||
|
self.body.append('`')
|
||||||
|
self.context.append("'")
|
||||||
|
|
||||||
def depart_emphasis(self, node: Element) -> None:
|
def depart_emphasis(self, node: Element) -> None:
|
||||||
self.body.append('}')
|
self.body.append(self.context.pop())
|
||||||
|
|
||||||
def is_samp(self, node: Element) -> bool:
|
def is_samp(self, node: Element) -> bool:
|
||||||
return 'samp' in node['classes']
|
return 'samp' in node['classes']
|
||||||
|
Loading…
Reference in New Issue
Block a user