Merge branch 'master' into 5196_linkcheck_should_check_remote_image

This commit is contained in:
Takeshi KOMIYA
2019-02-08 00:10:14 +09:00
committed by GitHub
39 changed files with 385 additions and 432 deletions

View File

@@ -0,0 +1,20 @@
highlight
---------
.. code-block::
"A code-block without no language"
.. code-block:: python2
"A code-block with language argument"
.. highlight:: python3
.. code-block::
"A code-block without no language after highlight directive"
.. code-block:: python2
"A code-block without language argument after highlight directive"

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="60" width="60">
<circle cx="40" cy="40" r="24" style="stroke:#000000; fill:#ffffff"/>
</svg>

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 243 B

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="60" width="60">
<circle cx="40" cy="40" r="24" style="stroke:#000000; fill:#ffffff"/>
</svg>

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 243 B

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="60" width="60">
<circle cx="40" cy="40" r="24" style="stroke:#000000; fill:#ffffff"/>
</svg>

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 243 B

View File

@@ -0,0 +1,49 @@
master_doc = 'index'
exclude_patterns = ['_build']
latex_elements = {
'preamble': r'''
\makeatletter
\def\dividetwolengths#1#2{\the\dimexpr
\numexpr65536*\dimexpr#1\relax/\dimexpr#2\relax sp}%
\newwrite\out
\immediate\openout\out=\jobname-dimensions.txt
\def\toout{\immediate\write\out}
\def\getWfromoptions #1width=#2,#3\relax{\def\WidthFromOption{#2}}%
\def\getHfromoptions #1height=#2,#3\relax{\def\HeightFromOption{#2}}%
\def\tempincludegraphics[#1]#2{%
\sphinxsafeincludegraphics[#1]{#2}%
\edef\obtainedratio
{\dividetwolengths\spx@image@requiredheight\spx@image@requiredwidth}%
\getWfromoptions#1,width=,\relax
\getHfromoptions#1,height=,\relax
\def\ratiocheck{}%
\ifx\WidthFromOption\empty\else
\ifx\HeightFromOption\empty\else
\edef\askedforratio{\dividetwolengths\HeightFromOption\WidthFromOption}%
\edef\ratiocheck{\dividetwolengths\obtainedratio\askedforratio}%
\fi\fi
\toout{original options = #1^^J%
width = \the\dimexpr\spx@image@requiredwidth,
linewidth = \the\linewidth^^J%
height = \the\dimexpr\spx@image@requiredheight,
maxheight = \the\spx@image@maxheight^^J%
obtained H/W = \obtainedratio^^J%
\ifx\ratiocheck\empty
\else
asked for H/W = \askedforratio^^J%
ratio of ratios = \ratiocheck^^J%
\fi
}%
\ifx\ratiocheck\empty
\else
\ifpdfabsdim\dimexpr\ratiocheck-1pt\relax > 0.01pt
\ASPECTRATIOERROR
\fi
\fi
}
\def\sphinxincludegraphics#1#{\tempincludegraphics#1}
\makeatother
''',
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@@ -0,0 +1,37 @@
====================
Test image inclusion
====================
Tests with both width and height
--------------------------------
.. an image with big dimensions, ratio H/W = 1/5
.. image:: img.png
:height: 200
:width: 1000
.. topic:: Oversized images
.. an image with big dimensions, ratio H/W = 5/1
.. image:: img.png
:height: 1000
:width: 200
.. height too big even if width reduced to linewidth, ratio H/W = 3/1
.. image:: img.png
:width: 1000
:height: 3000
Tests with only width or height
-------------------------------
.. topic:: Oversized images
.. tall image which does not fit in textheight even if width rescaled
.. image:: tall.png
:width: 1000
.. wide image which does not fit in linewidth even after height diminished
.. image:: sphinx.png
:height: 1000

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -40,9 +40,6 @@ html_sidebars = {'**': ['localtoc.html', 'relations.html', 'sourcelink.html',
html_last_updated_fmt = '%b %d, %Y'
html_context = {'hckey': 'hcval', 'hckey_co': 'wrong_hcval_co'}
applehelp_bundle_id = 'org.sphinx-doc.Sphinx.help'
applehelp_disable_external_tools = True
latex_additional_files = ['svgimg.svg']
coverage_c_path = ['special/*.h']

View File

@@ -1,2 +0,0 @@
This file should be included in the final bundle by the applehelp builder.
It should be ignored by other builders.

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="60" width="60">
<circle cx="40" cy="40" r="24" style="stroke:#000000; fill:#ffffff"/>
</svg>

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 243 B

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="60" width="60">
<circle cx="40" cy="40" r="24" style="stroke:#000000; fill:#ffffff"/>
</svg>

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 243 B