mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch 'stable'
This commit is contained in:
commit
1892fc18b9
4
CHANGES
4
CHANGES
@ -95,6 +95,10 @@ Features added
|
|||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
* #4085: Failed PDF build from image in parsed-literal using ``:align:`` option
|
||||||
|
* #4100: Remove debug print from autodoc extension
|
||||||
|
* #3987: Changing theme from alabaster causes HTML build to fail
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -716,7 +716,6 @@ class Documenter(object):
|
|||||||
# keep documented attributes
|
# keep documented attributes
|
||||||
keep = True
|
keep = True
|
||||||
isattr = True
|
isattr = True
|
||||||
print(membername, keep)
|
|
||||||
elif want_all and membername.startswith('_'):
|
elif want_all and membername.startswith('_'):
|
||||||
# ignore members whose name starts with _ by default
|
# ignore members whose name starts with _ by default
|
||||||
keep = self.options.private_members and \
|
keep = self.options.private_members and \
|
||||||
|
@ -1700,9 +1700,6 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
pre = [] # type: List[unicode]
|
pre = [] # type: List[unicode]
|
||||||
# in reverse order
|
# in reverse order
|
||||||
post = [] # type: List[unicode]
|
post = [] # type: List[unicode]
|
||||||
if self.in_parsed_literal:
|
|
||||||
pre = ['\\begingroup\\sphinxunactivateextrasandspace\\relax ']
|
|
||||||
post = ['\\endgroup ']
|
|
||||||
include_graphics_options = []
|
include_graphics_options = []
|
||||||
is_inline = self.is_inline(node)
|
is_inline = self.is_inline(node)
|
||||||
if 'width' in attrs:
|
if 'width' in attrs:
|
||||||
@ -1742,6 +1739,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
post.append(align_prepost[is_inline, attrs['align']][1])
|
post.append(align_prepost[is_inline, attrs['align']][1])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
if self.in_parsed_literal:
|
||||||
|
pre.append('{\\sphinxunactivateextrasandspace ')
|
||||||
|
post.append('}')
|
||||||
if not is_inline:
|
if not is_inline:
|
||||||
pre.append('\n\\noindent')
|
pre.append('\n\\noindent')
|
||||||
post.append('\n')
|
post.append('\n')
|
||||||
|
13
tests/roots/test-image-in-parsed-literal/conf.py
Normal file
13
tests/roots/test-image-in-parsed-literal/conf.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
master_doc = 'index'
|
||||||
|
exclude_patterns = ['_build']
|
||||||
|
|
||||||
|
rst_epilog = '''
|
||||||
|
.. |picture| image:: pic.png
|
||||||
|
:height: 1cm
|
||||||
|
:scale: 200%
|
||||||
|
:align: middle
|
||||||
|
:alt: alternative_text
|
||||||
|
'''
|
||||||
|
|
9
tests/roots/test-image-in-parsed-literal/index.rst
Normal file
9
tests/roots/test-image-in-parsed-literal/index.rst
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
test-image-in-parsed-literal
|
||||||
|
============================
|
||||||
|
|
||||||
|
Dummy text
|
||||||
|
|
||||||
|
.. parsed-literal::
|
||||||
|
|
||||||
|
|picture|\ AFTER
|
||||||
|
|
BIN
tests/roots/test-image-in-parsed-literal/pic.png
Normal file
BIN
tests/roots/test-image-in-parsed-literal/pic.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 120 B |
@ -1028,3 +1028,13 @@ def test_latex_index(app, status, warning):
|
|||||||
result = (app.outdir / 'Python.tex').text(encoding='utf8')
|
result = (app.outdir / 'Python.tex').text(encoding='utf8')
|
||||||
assert 'A \\index{famous}famous \\index{equation}equation:\n' in result
|
assert 'A \\index{famous}famous \\index{equation}equation:\n' in result
|
||||||
assert '\n\\index{Einstein}\\index{relativity}\\ignorespaces \nand' in result
|
assert '\n\\index{Einstein}\\index{relativity}\\ignorespaces \nand' in result
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.sphinx('latex', testroot='image-in-parsed-literal')
|
||||||
|
def test_latex_image_in_parsed_literal(app, status, warning):
|
||||||
|
app.builder.build_all()
|
||||||
|
|
||||||
|
result = (app.outdir / 'Python.tex').text(encoding='utf8')
|
||||||
|
assert ('{\\sphinxunactivateextrasandspace \\raisebox{-0.5\height}'
|
||||||
|
'{\\scalebox{2.000000}{\\sphinxincludegraphics[height=1cm]{{pic}.png}}}'
|
||||||
|
'}AFTER') in result
|
||||||
|
Loading…
Reference in New Issue
Block a user