Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #9962: texinfo: Do not use @definfoenclose to empasize string #9991

Merged
merged 1 commit into from Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES
Expand Up @@ -7,6 +7,8 @@ Dependencies
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
from an empty list to ``['std:doc']`` as avoid too surprising silent
intersphinx resolutions.
Expand All @@ -23,6 +25,9 @@ Features added
Bugs fixed
----------

* #9962: texinfo: Deprecation message for ``@definfoenclose`` command on
bulding texinfo document

Testing
--------

Expand Down
16 changes: 0 additions & 16 deletions doc/faq.rst
Expand Up @@ -350,19 +350,3 @@ The following notes may be helpful if you want to create Texinfo files:
scheme ``info``. For example::

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,_,_
"""}
16 changes: 9 additions & 7 deletions sphinx/writers/texinfo.py
Expand Up @@ -58,8 +58,6 @@
@exampleindent %(exampleindent)s
@finalout
%(direntry)s
@definfoenclose strong,`,'
@definfoenclose emph,`,'
@c %%**end of header

@copying
Expand Down Expand Up @@ -805,17 +803,21 @@ def depart_line(self, node: Element) -> None:
# -- Inline

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

def depart_strong(self, node: Element) -> None:
self.body.append('}')
self.body.append("'")

def visit_emphasis(self, node: Element) -> None:
element = 'emph' if not self.in_samp else 'var'
self.body.append('@%s{' % element)
if self.in_samp:
self.body.append('@var{')
self.context.append('}')
else:
self.body.append('`')
self.context.append("'")

def depart_emphasis(self, node: Element) -> None:
self.body.append('}')
self.body.append(self.context.pop())

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