Commit Graph

2646 Commits

Author SHA1 Message Date
jfbu
669f9c3a13 LaTeX: safer image inclusion
Closes: #5956
2019-01-29 11:15:49 +01:00
Takeshi KOMIYA
353e992b37 refactor: test_build_html.py 2019-01-26 17:06:47 +09:00
Takeshi KOMIYA
36d628929e Merge branch '1.8' 2019-01-26 13:40:19 +09:00
Frank Erens
9e6fe21c6a Add 'cpp:struct' directive and 'cpp:struct' role.
They are cosmetic variants of the class directive/role.
2019-01-20 12:29:20 +01:00
Jakob Lykke Andersen
ffdc4db2c1 C++, minor fixes 2019-01-20 10:28:39 +01:00
Takeshi KOMIYA
bc805fb8bc
Merge pull request #5969 from tk0miya/progress_message2
refactoring progress messages
2019-01-20 13:38:20 +09:00
Takeshi KOMIYA
1182e7f6d2 refactor: compile .mo file only if needed on testing 2019-01-20 11:51:23 +09:00
Takeshi KOMIYA
6968889206
Merge pull request #5968 from tk0miya/separate_qthelp
Separate qthelp to sphinxcontrib package
2019-01-20 00:28:08 +09:00
Takeshi KOMIYA
c5f20a9046 progress_message() supports a skip 2019-01-19 20:48:21 +09:00
Takeshi KOMIYA
6be9d2a08e Separate qthelp to sphinxcontrib package 2019-01-19 16:34:06 +09:00
jfbu
ff5031c96e Merge branch '1.8'
Resolved Conflicts:
	sphinx/writers/latex.py
2019-01-17 17:26:51 +01:00
jfbu
e7aee6e82a LaTeX: remove usage of \scalebox by incorporating scale in height/width
Closes: #5954
2019-01-14 16:04:04 +01:00
Takeshi KOMIYA
0081482eb7
Merge pull request #5949 from tk0miya/4064_removes_assets_for_websupport
Remove assets for websupport (refs: #4064)
2019-01-14 00:56:52 +09:00
Takeshi KOMIYA
2569776ffd Remove assets for websupport (refs: #4064) 2019-01-14 00:30:36 +09:00
Takeshi KOMIYA
d6fc5c9095 Stop to use $SPHINX_TEST_TEMPDIR envvar
At once, we added $SPHINX_TEST_TEMPDIR to keep intermediate files of
testing to investigate the failures.  At present, we've used pytest
as a test runner.  And it keeps temporary directories of last 3
testings.  So this starts to use it instead of $SPHINX_TEST_TEMPDIR.
https://docs.pytest.org/en/latest/tmpdir.html#the-default-base-temporary-directory
2019-01-13 23:50:18 +09:00
Takeshi KOMIYA
a4a206ce5a
Merge pull request #5930 from tk0miya/refactor_subprocess.run
Use subprocess.run() instead of Popen()
2019-01-13 23:34:17 +09:00
Takeshi KOMIYA
46334a2b00 Use subprocess.run() instead of Popen()
Since python3.5, subprocess.run() has been introduced. It works a
wrapper of Popen, and it looks much simple and better. This uses it
instead of Popen to make our code simple.
2019-01-13 23:25:54 +09:00
Timotheus Kampik
0457d6ebba
WIP: 5258 fix search highlight svg ff (#5265)
* #5258 add tests for highlightText()

*  #5258 fix SVG search highlight issue in Firefox

 Use `node.parentElement.getBBox()` instead of `span.getBBox()`:

* Same highlighting behavior in Chrome, Opera

* Avoid issue with getBBox() in FF, see:
  https://bugzilla.mozilla.org/show_bug.cgi?id=612118

* Microsoft browsers to be tested

*  #5258 update package-lock.json

* #5258 test after control merge & polish

* #5258 allow for some variability in test
2019-01-13 14:06:03 +01:00
Takayuki SHIMIZUKAWA
795b518464
Add PathComparer for testing and fix 2 test failure on Windows. (#5943)
commits are squashed.

* Add PathComparer for testing and fix 2 test failure on Windows.
* fix flake8
* add type information by f2f review. Thanks to @tk0miya!
* fix mypy, flake8 again..
2019-01-13 18:40:35 +09:00
Takeshi KOMIYA
01ccbbcccf Fix test: NamedTemporaryFile causes errors on Windows 2019-01-13 17:43:11 +09:00
Takeshi KOMIYA
20bf74c637 Separate jsmath to sphinxcontrib package 2019-01-13 14:07:12 +09:00
Takeshi KOMIYA
ae60ed5b0b Merge branch '1.8' 2019-01-13 11:44:08 +09:00
Timotheus Kampik
64e64ffbd4 #5258 allow for some variability in test 2019-01-12 15:58:07 +01:00
Timotheus Kampik
c761ec248b #5258 test after control merge & polish 2019-01-12 14:48:35 +01:00
Takeshi KOMIYA
a06f6b71b4 Fix an error with pytest-4.x 2019-01-12 21:08:51 +09:00
Timotheus Kampik
15a7f767b4 Merge branch 'master' into 5258-fix-search-highlight-svg-ff 2019-01-12 11:20:33 +01:00
Takeshi KOMIYA
90b93dda33
Merge pull request #5384 from tk0miya/smart_latex_conf_py
quickstart: Simplify generated conf.py (for latex)
2019-01-08 02:12:38 +09:00
Takeshi KOMIYA
66228fb60f Fix #5906: LaTeX Builder is not initialized correctly on test_markup 2019-01-08 01:30:25 +09:00
Takeshi KOMIYA
46b19b29f3 latex: Do escape_abbr() for author and project 2019-01-07 23:14:56 +09:00
Takeshi KOMIYA
68c90a26f1 quickstart: Simplify generated conf.py (for latex) 2019-01-07 23:06:14 +09:00
Jakob Lykke Andersen
e9df857531 C++, parse all fold expressions 2019-01-06 12:03:17 +01:00
Jakob Lykke Andersen
8eb4ab0681 C++ fixes
- Hyperlinks for declarations involving east cv-qualifiers.
- Duplicate declaration error on function templates with constraints
  in the return type.
  Fixes sphinx-doc/sphinx#5755
2019-01-06 12:03:17 +01:00
jfbu
259d5053fa LaTeX: fix `addtocaptions` for sphinxmessages.sty_t if 'babel' empty
For example if config setting `language` is 'ja'.

Refs: #5516
2019-01-06 10:05:02 +01:00
jfbu
af2bb9f80d Merge branch '1.8'
Conflicts:
	sphinx/writers/latex.py
	tests/test_build_latex.py

Also, modifications were needed in further files.

	modified:   CHANGES
	modified:   sphinx/templates/latex/sphinxmessages.sty_t
	modified:   sphinx/util/template.py
	modified:   sphinx/util/texescape.py
	modified:   sphinx/writers/latex.py
	modified:   tests/test_build_latex.py
2019-01-05 11:00:19 +01:00
jfbu
2259466d4b Remove some spaces added in last commit, which are ignored anyhow 2019-01-05 00:14:45 +01:00
jfbu
37f1aacd1f LaTeX do not strip spaces from numfig_format split at %s
Only for figure and table, currently. Code-bloks have some FIXME code to
still be handled.

PDF output should remain unchanged so this is backwards compatible. The
`\nobreakspace` from LaTeX default `\fnum@figure` is removed by a normal
space. If figname is an abbreviation, the dot is followed by a `\@` to
avoid double space. At the location where the `\@` is inserted the `@`
has catcode non-letter so a space after it is not swallowed.

MEMO: when this is will be moved to sphinxmessages.sty on master branch
it is needed to use `\@{}` or to modify locally catcode of `@` to avoid
space swallowing..

Closes: #5889
2019-01-04 23:53:17 +01:00
jfbu
18bf90822c Fix LaTeX writer handling of user custom numfig_format 2019-01-04 23:35:30 +01:00
Takeshi KOMIYA
cd28de5ba8 refactor: Move \literalblockname to sphinxmessage.sty 2019-01-04 23:06:34 +09:00
Takeshi KOMIYA
ebd484ead2 refactor: Move \tablename to sphinxmessage.sty 2019-01-04 23:06:34 +09:00
Takeshi KOMIYA
1c34501e85 refactor: Move \figurename to sphinxmessage.sty 2019-01-04 23:06:34 +09:00
Takeshi KOMIYA
7459d8771a Fix HTML: Invalid HTML5 file is generated for glossary (refs: #4611)
Note: It was caused by a glossary having multiple terms for one
description.
2019-01-03 18:17:17 +09:00
Takeshi KOMIYA
a0e1390472 Remove use of deprecated APIs 2019-01-03 13:27:33 +09:00
Takeshi KOMIYA
64df1d1e89
Merge pull request #5880 from tk0miya/omit_master_doc
test: Omit master_doc settings from testcases
2019-01-03 11:20:26 +09:00
Takeshi KOMIYA
114ff77f68 test: Omit master_doc settings from testcases 2019-01-03 10:58:42 +09:00
Takeshi KOMIYA
c4c878303f encoding keyword for path.text() and path.write_text() is no longer needed 2019-01-03 10:58:07 +09:00
Takeshi KOMIYA
5428d94d24 Remove coding magic comments from tests 2019-01-02 21:53:07 +09:00
Takeshi KOMIYA
da3075d0b7 A happy new year! 2019-01-02 16:17:25 +09:00
Takeshi KOMIYA
76e9f57c2e Merge branch '1.8' 2019-01-02 16:16:25 +09:00
Takeshi KOMIYA
1b1ebd2c75 A happy new year! 2019-01-02 16:00:30 +09:00
jfbu
32d57b8637 Merge branch '1.8'
resolved Conflicts:
	doc/development/tutorials/todo.rst
	sphinx/locale/__init__.py
	sphinx/search/zh.py
2018-12-28 12:50:20 +01:00
Timotheus Kampik
221614654f
#5605 fix Chinese search index (#5611)
generate search index for Latin words correctly if search language is Chinese
2018-12-25 18:41:52 +01:00
Takeshi KOMIYA
99a7dca216
Merge pull request #5806 from jdufresne/six-text-type
Replace use of six.text_type with str
2018-12-26 01:31:33 +09:00
Takeshi KOMIYA
b5c0edc949 Merge branch '1.8' 2018-12-26 00:37:55 +09:00
Timotheus Kampik
b779975a44 Merge branch 'master' into 5660-version-modified-classes 2018-12-24 14:57:42 +01:00
Takeshi KOMIYA
6ffe549f49 refactor chm_htmlescape() 2018-12-24 13:54:53 +09:00
Timotheus Kampik
edf9d210b6 #5660 adjust expected result to new classes
Also, fix formating glitch
2018-12-23 17:02:31 +01:00
Takeshi KOMIYA
4702086681 Merge branch '1.8' 2018-12-24 00:49:36 +09:00
animalize
9052471e19 don't generate build files inside /tests/roots/ 2018-12-23 22:16:03 +08:00
animalize
cedd94c541 [1.8] htmlhelp: convert hex escaping to decimal escaping in .hhc/.hhk files (#5853)
* htmlhelp: convert hex escaping to decimal escaping in .hhc/.hhk files

.hhc/.hhk files don't recognize hex escaping, we need convert hex escaping to decimal escaping. for example: `'` -> `'`.
2018-12-23 22:39:12 +09:00
jfbu
701b39328f Merge branch '1.8'
(Resolved) Conflicts:
	sphinx/texinputs/sphinxmanual.cls
2018-12-23 11:23:04 +01:00
Takeshi KOMIYA
f06e84ac4f Fix #5800: todo: crashed if todo is defined in TextElement 2018-12-22 01:10:23 +09:00
Jon Dufresne
6978918ffc Replace use of six.text_type with str
This removes the last use of the six package allowing Sphinx to remove
it as a dependency.
2018-12-18 16:23:10 -08:00
Takeshi KOMIYA
3905cb8b7c Merge branch '1.8' 2018-12-18 23:32:52 +09:00
Takeshi KOMIYA
f04e161173
Merge pull request #5826 from tk0miya/refactor_intersphinx
intersphinx: Normalize mapping on config-inited
2018-12-18 23:29:25 +09:00
Takeshi KOMIYA
4c149f6458
Merge pull request #5835 from goerz/1.8
Use mathjax CDN "latest" URL by default
2018-12-18 23:07:42 +09:00
jfbu
bd2ca4763c [tests] LaTeX: use latex engines with `--halt-on-error` option 2018-12-18 13:41:48 +01:00
Michael Goerz
77e617e25a Use mathjax CDN "latest" URL by default
Closes #5725
2018-12-17 22:14:25 -05:00
Jon Dufresne
43ff640b58 Deprecate quickstart.term_decode() and remove internal uses
Per the Python 3 docs, input() always returns a string:

https://docs.python.org/3/library/functions.html#input

> The function then reads a line from input, converts it to a
> string (stripping a trailing newline), and returns that.

The stubs from typeshed say the same:

5c69373890/stdlib/3/builtins.pyi (L835)

Here is the implementation from CPython with also shows a call to
PyUnicode_Decode on the result:

https://github.com/python/cpython/blob/3.7/Python/bltinmodule.c#L1960-L2143

As the value is always a string, there is nothing to decode. Therefore
the call to term_decode() unnecessary and can safely be removed.

With this in mind, must adjust quickstart tests to be more
representative.
2018-12-17 06:44:17 -08:00
Takeshi KOMIYA
556f599e6e intersphinx: Normalize mapping on config-inited 2018-12-17 22:03:47 +09:00
Takeshi KOMIYA
5e5bdb8a64 Remove absolute_import 2018-12-17 20:47:49 +09:00
Takeshi KOMIYA
8ea3f7fad9
Merge pull request #5509 from stephenfin/remove-future-imports
Remove future imports
2018-12-17 20:32:39 +09:00
Takeshi KOMIYA
d8b69c7f98
Merge pull request #5819 from jdufresne/coding-comment
Remove unnecessary encoding cookie from Python source files
2018-12-17 19:15:00 +09:00
Jon Dufresne
e9c87b3d13 Fix invalid escape sequence in test_directive_code.py
Fixes error when running tests:

tests/test_directive_code.py:359
  sphinx/tests/test_directive_code.py:359: DeprecationWarning: invalid escape sequence \s
    includes = '\\end{sphinxVerbatim}\n\sphinxresetverbatimhllines\n'
2018-12-17 11:11:41 +01:00
Takeshi KOMIYA
c7ed4f3ddd
Merge pull request #5814 from jdufresne/str-format-coerce
Remove redundant coerce to str in string formatting
2018-12-17 19:08:28 +09:00
Takeshi KOMIYA
71a7ce1453
Merge branch 'master' into string-classes 2018-12-17 18:58:32 +09:00
Stephen Finucane
5a9033e5aa Specifically request Python 3
If Sphinx is Python 3-only, Sphinx's tooling should be Python 3-only
too.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-12-17 09:46:18 +00:00
Stephen Finucane
d345d0f8c1 py3: Remove (most) __future__ imports
There were two used:

- print_function
- absolute_import

Both of these are mandatory in Python 3.0 onwards [1] and can therefore
be removed...mostly. Unfortunately, mypy is still running in Python 2.7
mode, meaning we need the 'print_function' future wherever we're calling
'print' with the 'file' argument. There's also a single
'absolute_import' future that must be retained as its removal breaks a
test for as-yet unknown reasons.  TODOs are added to resolve both issues
in the future.

[1] https://docs.python.org/3/library/__future__.html

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-12-17 09:46:15 +00:00
Jon Dufresne
d210da96f6 Fix invalid escape sequence in test_directive_code.py
Fixes error when running tests:

tests/test_directive_code.py:359
  sphinx/tests/test_directive_code.py:359: DeprecationWarning: invalid escape sequence \s
    includes = '\\end{sphinxVerbatim}\n\sphinxresetverbatimhllines\n'
2018-12-16 13:37:47 -08:00
Jon Dufresne
bade33c7e4 Remove unnecessary encoding cookie from Python source files
In Python 3, the default encoding of source files is utf-8. The encoding
cookie is now unnecessary and redundant so remove it. For more details,
see the docs:

https://docs.python.org/3/howto/unicode.html#the-string-type

> The default encoding for Python source code is UTF-8, so you can
> simply include a Unicode character in a string literal ...

Includes a fix for the flake8 header checks to stop expecting an
encoding cookie.
2018-12-16 12:22:12 -08:00
Jon Dufresne
80861d105b Deprecate sphinx.config.string_classes; remove all internal uses
With only a single text type across supported Python versions, the
string_classes is no longer necessary.

Internally, all uses were converted to the value `[str]`. For
.add_config_value() uses that also supply a default string, the type is
inferred.
2018-12-16 11:35:06 -08:00
Jon Dufresne
2b0096fba9 Remove redundant coerce to str in string formatting
When an object is passed to a string format placeholder '%s', Python
will implicitly call str() on the object. This applies to print() and
logging as well.
2018-12-16 10:03:45 -08:00
jfbu
30ec4b6bba Merge branch '1.8' 2018-12-16 18:34:05 +01:00
Jakob Lykke Andersen
73a8b7e658 Merge branch 'cpp_fix_float_literals' into 1.8 2018-12-16 17:19:57 +01:00
Jakob Lykke Andersen
b3de33deef C++, fix parsing of floating point literals
Fixes sphinx-doc/sphinx#5636
2018-12-16 16:56:55 +01:00
jfbu
88a019dc99 LaTeX: allow sphinxVerbatim usage without explicit "hllines" extra setup
Fixes: #5810
2018-12-16 16:54:28 +01:00
Takeshi KOMIYA
c6bd84a614 refactor: Remove u-prefix from strings 2018-12-16 21:28:51 +09:00
Takeshi KOMIYA
ea1d2d06f8
Merge pull request #5803 from jdufresne/encoding-utf8
Avoid respecifying default encoding for .encode()/.decode() calls
2018-12-16 20:01:43 +09:00
Takeshi KOMIYA
2597c4174e
Merge pull request #5796 from jdufresne/super
Use Python 3 super() argument-less syntax
2018-12-16 19:46:47 +09:00
Jon Dufresne
5bf25eb445 Avoid respecifying default encoding for .encode()/.decode() calls
In Python 3, both .encode() and .decode() default the encoding to
'utf-8'. See the docs:

https://docs.python.org/3/library/stdtypes.html#str.encode
https://docs.python.org/3/library/stdtypes.html#bytes.decode

Simplify and shorten the code by using the default instead of
respecifying it.
2018-12-15 17:19:56 -08:00
Jon Dufresne
49d3a3c0c1 Replace ENOENT errno checks with Python 3 FileNotFoundError
The error is more specific and self documenting.

This removes the last use of sphinx.util.osutil.ENOENT, so it is now
deprecated for removal. sphinx.util.osutil.EEXIST was already unused so
that is deprecated as well.
2018-12-15 09:02:55 -08:00
Jon Dufresne
ade973f4e3 Use Python 3 super() argument-less syntax
The form is less verbose and more idiomatic for Python 3 only code.

https://docs.python.org/3/library/functions.html#super
2018-12-15 08:35:55 -08:00
Takeshi KOMIYA
c70e65fc6c
Merge branch 'master' into 5770_doctest_refers_highlight_language 2018-12-16 00:32:10 +09:00
Takeshi KOMIYA
b56f4f9022 Remove print_function feature 2018-12-15 23:16:10 +09:00
Takeshi KOMIYA
415ebc15c5
Merge pull request #5784 from tk0miya/refactor_hack_for_py2
Refactor hack for py2
2018-12-15 22:40:46 +09:00
Takeshi KOMIYA
66fad4e22d Remove a hack for py2 from testcode 2018-12-15 22:01:22 +09:00
Takeshi KOMIYA
fd1dd13a50 refactor: Replace six.StringIO by io.StringIO 2018-12-15 21:00:38 +09:00
Takeshi KOMIYA
001a557fcf
Merge pull request #5781 from tk0miya/refactor_six.PY2
refactor: Drop six.PY2
2018-12-15 20:57:51 +09:00
Takeshi KOMIYA
e789080b54 refactor: Drop six.PY2 2018-12-15 20:08:39 +09:00
Takeshi KOMIYA
5f8b1ede8e refactor: Replace six.add_metaclass by __metaclass_ attribute 2018-12-15 20:06:26 +09:00
Takeshi KOMIYA
d6d4406ce9 Fix #5770: doctest: Follow highlight_language on highlighting doctest block 2018-12-15 18:35:12 +09:00
Takeshi KOMIYA
389f756f88 refactor: special rubric for footnotes 2018-12-10 00:07:25 +09:00
Takeshi KOMIYA
8a6179aa61 Process prolog and epilog on RSTParser (instead Input component) 2018-12-05 23:11:16 +09:00
Takeshi KOMIYA
5fa8ca492b Add prepend_prolog() and append_epilog() 2018-12-05 23:10:23 +09:00
Takeshi KOMIYA
ab3eb1b61d Add testcases for mock() 2018-12-04 23:57:01 +09:00
Takeshi KOMIYA
825426c841 refactor figure_wrapper() using state.inline_text() 2018-12-04 01:14:53 +09:00
Takeshi KOMIYA
b3d71ca683
Merge branch 'master' into refactor_SphinxTranslator 2018-12-03 23:16:03 +09:00
Takeshi KOMIYA
3863256cb6 Add SphinxTranslator as an abstract class 2018-12-03 22:30:56 +09:00
Takeshi KOMIYA
b76966815c Fix annotations of testing 2018-12-03 22:22:07 +09:00
Takeshi KOMIYA
28add225f2 Merge branch '1.8' 2018-12-02 22:26:12 +09:00
Takeshi KOMIYA
e8ea448474
Merge pull request #5699 from tk0miya/smart_manpage_conf_py
quickstart: Simplify generated conf.py (for manpage)
2018-12-02 18:18:55 +09:00
Takeshi KOMIYA
a5e7e85e92 quickstart: Simplify generated conf.py (for manpage) 2018-12-02 17:57:20 +09:00
Takeshi KOMIYA
5e1c45355e quickstart: Simplify generated conf.py (for htmlhelp) 2018-12-02 11:30:40 +09:00
Takeshi KOMIYA
e527be396a
Merge pull request #5607 from tk0miya/smart_texinfo_conf_py
quickstart: Simplify generated conf.py (for texinfo)
2018-12-02 01:30:51 +09:00
Takeshi KOMIYA
8608102da6 Refactor metadata handling 2018-11-30 17:56:19 +09:00
Takeshi KOMIYA
3808405b50 Fix #5659: linkcheck: crashes for a hyperlink containing multibyte character 2018-11-25 01:37:32 +09:00
Takeshi KOMIYA
722c92250c Fix #5648: NodeMatcher matches Text node on attribute match 2018-11-25 01:16:17 +09:00
Takeshi KOMIYA
b2f069ba6e Add testcase for default_texinfo_documents 2018-11-24 01:23:27 +09:00
Jon Dufresne
d99e2cae19 Deprecate evaluating Python 2 syntax in configuration files 2018-11-22 19:05:14 -08:00
Takeshi KOMIYA
4761e70c37 Merge branch '1.8' 2018-11-22 22:14:32 +09:00
Jean-François B
8412bdf9d6
Merge pull request #5645 from jfbu/latex_greek_cyrillic_letters
LaTeX: support for Greek and Cyrillic
2018-11-21 23:11:15 +01:00
Jon Dufresne
77849f0ef6 Simplify ensuredir() with Python3 stdlib features
- Simplify ensuredir() to equivalent os.makedir(name, exist_ok=True)
- Do not check if a directory exists before calling
  ensuredir() (ensuredir() already handles it)
- Add exist_ok argument to path.makedirs() to follow same pattern
- Drop unnecessary .exists() check immediately before .isdir()
- Add tests for ensuredir
2018-11-20 18:37:05 -08:00
jfbu
4457038550 LaTeX: compatibility with caption package, 2nd part
Ensure same vertical spaces above caption for tabular(y) and longtable
rendered tables.

Fixes: #5520
2018-11-18 00:40:28 +01:00
jfbu
2825e338c2 LaTeX: support for Greek and Cyrillic
0. do not escape Unicode Greek letters via LaTeX math mark-up: pass them
   through un-modified to LaTeX document,

1. if "fontenc" receives extra option LGR, then pdflatex will support
   Unicode Greek letters (not in math), and with extra option T2A it
   will support (most) Unicode Cyrillic letters.

2. for pdflatex with LGR, this will use "textalpha" LaTeX package and
   "substitutefont" package to set up some automatic font substitution
   to work around the unavailability of Greek with "times"
   package (which is default font package chosen by Sphinx for
   pdflatex), same with T2A and "substitutefont" for Cyrillic.

3. for xelatex/lualatex, set up Computer Modern Unicode as default font,
   as it supports Cyrillic and Greek scripts,

4. for platex, don't do anything special as the engine already has
   its default font supporting Cyrillic and Greek (even in math mode!)

Closes: #5251
Fixes:  #5248
Fixes:  #5247
2018-11-16 21:14:51 +01:00
Takeshi KOMIYA
6c94801ec2
Merge pull request #5621 from jdufresne/str-bytes
Fix all BytesWarning identified through tests
2018-11-14 20:05:48 +09:00
Jon Dufresne
4cda774566 Improve JS handling in test_search.py
- Reuse jsload() in all tests to reduce duplication.
- Fix -2 index to -1, to include the entire JSON string. Was previously
  chopping off the final '}'.
- Assert the serialized string ends with a closing parenthesis
2018-11-13 21:25:46 -08:00
Jon Dufresne
41ad0d5347 Fix all BytesWarning identified through tests
Code should not arbitrarily mix bytes & str values. The values should be
understood and deliberate. When Python is run with the -b option, this
change fixes warnings of the form:

  BytesWarning: str() on a bytes instance
2018-11-13 18:08:49 -08:00
Jean-François B
3a512ef68c
Merge branch '1.8' into 5520_latex_caption_package 2018-11-14 00:12:27 +01:00
jfbu
7f19885641 LaTeX: compatibility with caption package
This compatibility is mainly re-instored for convenience of user to
style the fonts used for the caption, and also possibly influence the
horizontal position via "width" or "margin" option of caption package
(attention that caption package obeys the document class tacit "twoside"
option, so if left and right margins are not set-up to be the same,
positioning of caption will depend on parity of the page number).

Regarding vertical skips, for captions placed on top (which is the table
templates default and also the literalblockcappos default), this commit
ensures that the vertical spacing separating the caption last baseline
to the top of framing is governed by \sphinxbelowcaptionspace in all
these three cases: tabular(y), longtable, literal blocks; the "skip"
option of caption package is ignored for them.

The "skip" is obeyed for the spacing between an image and its caption,
which currently in Sphinx is always below the image (no customization of
the figure caption vertical placement is currently available).

If literalblockcappos is "b" (captions follow code-blocks), this commit
removes the caption-package added \abovecaptionskip, so that "skip" is
also ignored for code-blocks in this case. This looks better due to the
extra space already added by the framing of the code-block and achieves
same spacing as without caption package (presumably loaded mainly to
style the fonts used for the caption). However in future maybe caption's
package "skip" should be obeyed for "literalblock" caption type.

Fixes: 5520
2018-11-13 23:55:11 +01:00
Jon Dufresne
555960d668 Deprecate and drop internal use of force_decode()
In the Python 3 only code base, this function is no longer necessary.
The type of values is well understood and deliberate. Code should avoid
arbitrary mixing of bytes & str.

By removing force_decode() calls from docstring values, can deprecate
the now unused 'encoding' arguments to various autodoc methods.
2018-11-13 07:16:39 -08:00
Jon Dufresne
444a7212b6 Fix "invalid escape sequence" warnings emitted during tests
sphinx/tests/test_quickstart.py:221: DeprecationWarning: invalid escape sequence '\*'
    content = filename.bytes().decode('unicode-escape')
  sphinx/tests/test_quickstart.py:221: DeprecationWarning: invalid escape sequence '\`'
    content = filename.bytes().decode('unicode-escape')
2018-11-13 07:14:24 -08:00
Jon Dufresne
0137b0287a Remove dead code or '.'
The expression `os.path.dirname(__file__)` always evaluates as a truthy
value. The `or '.'` is never evaluated.
2018-11-12 14:31:29 -08:00
Takeshi KOMIYA
33a60ee80e Fix #5614: autodoc: incremental build is broken when builtin modules are imported 2018-11-13 01:05:13 +09:00
Jon Dufresne
710ca3d7c3 Use super() to call parent class's method 2018-11-11 13:07:12 -08:00
Takeshi KOMIYA
0ccc64d9ea test: Filter warnings on testing 2018-11-12 00:37:51 +09:00
Takeshi KOMIYA
bdaedbcbe4 quickstart: Simplify generated conf.py (for texinfo) 2018-11-11 21:57:14 +09:00
Takeshi KOMIYA
9c4e5b244a test: Replace call_autodoc() by do_autodoc() 2018-11-11 21:22:11 +09:00
Takeshi KOMIYA
2810f77edd Merge branch '1.8' 2018-11-09 22:10:35 +09:00
Takeshi KOMIYA
b28ab1e103
Merge pull request #5600 from tk0miya/3080_invalid_texinfo
Fix #3080: multiline rubrics and citations are broken in texinfo builder
2018-11-09 22:08:51 +09:00
Takeshi KOMIYA
feba53ff55 Fix #3080: texinfo: multiline citations are broken 2018-11-08 23:33:00 +09:00
Takeshi KOMIYA
84f781252f Fix #3080: texinfo: multiline rubric is broken 2018-11-08 23:33:00 +09:00
jfbu
16f47cded9 Merge branch '1.8' 2018-11-06 18:30:21 +01:00
Takeshi KOMIYA
dcc4ac55bb latex: Move \pageautorefname to sphinxmessages.sty 2018-11-01 22:47:15 +09:00
jfbu
4df3b067b7 LaTeX: add styling to general index, similar to domain indices
Closes: #5579. Also closes #5576.
2018-10-31 19:22:34 +01:00
Takeshi KOMIYA
8b687ac304 Merge branch '1.8' 2018-11-01 01:24:12 +09:00
Takeshi KOMIYA
e3574a6f78 Fix #3002: i18n: multiple footnote_references referring same footnote causes duplicated node_ids 2018-11-01 00:54:25 +09:00
Takeshi KOMIYA
08aadcffcd
Merge pull request #5559 from JulienPalard/text-colspan-rowspan
Working on text colspan and rowspan.
2018-11-01 00:42:02 +09:00
jfbu
f4d7b2e60e Fix invalid escape sequence \d in test (refs #5513) 2018-10-30 17:47:59 +01:00
Julien Palard
dfa1824f19 Removing unnecessary indent. 2018-10-28 08:42:36 +01:00
Takeshi KOMIYA
a4cce3e561
Merge pull request #5546 from tk0miya/refactor_test_root
test: Move autodoc_missing_imports to test-ext-autodoc
2018-10-25 23:55:07 +09:00
Takeshi KOMIYA
1af1d8a82b
Merge pull request #5536 from tk0miya/5497_install_mathjax_only_if_needed
Fix #5497: Do not include MathJax.js and jsmath.js unless it is really needed
2018-10-25 23:03:38 +09:00
Julien Palard
d527497b1f Moar tests 2018-10-23 18:41:08 +02:00
Julien Palard
9b30fc938d Working on text colspan and rowspan. 2018-10-22 23:38:01 +02:00
Takeshi KOMIYA
ca8bc8ca49 refactor: Deprecate app._setting_up_extension 2018-10-17 11:56:11 +09:00
Takeshi KOMIYA
ea03286647 test: Move autodoc_missing_imports to test-ext-autodoc 2018-10-17 11:36:11 +09:00
Takeshi KOMIYA
4ed5c51cff logging: Add prefixed_warnings() helper 2018-10-17 11:21:22 +09:00
Takeshi KOMIYA
44b385e2c9
Merge pull request #5533 from ericvw/autodoc_member-only_default-options
autodoc: Respect `member-order` in `autodoc_default_options` as documented
2018-10-17 11:12:56 +09:00
Takeshi KOMIYA
2e6e940df8 Fix #5497: Do not include MathJax.js and jsmath.js unless it is really needed 2018-10-17 01:42:17 +09:00
Takeshi KOMIYA
7e23a061b3 Fix typo 2018-10-16 10:34:59 +09:00
Takeshi KOMIYA
84e1eeb8a2 Move env.doc2path() and env.path2doc() to Project class 2018-10-16 10:34:59 +09:00
Takeshi KOMIYA
eaec3bd916 Add sphinx.project; a manipulator for project and documents 2018-10-16 10:34:58 +09:00
Takeshi KOMIYA
e7e07fd697 Merge branch '1.8' 2018-10-16 09:57:54 +09:00
Takeshi KOMIYA
793792fafc Fix #5480: autodoc: unable to find type hints for unresolvable Forward references 2018-10-15 23:40:05 +09:00
Eric N. Vander Weele
d6b9db9581 tests: Ensure 'member-only' autodoc_default_options is respected
When specifying the 'member-only' option to `autodoc_default_options`,
ensure it is respected.
2018-10-14 20:18:59 -04:00
Takeshi KOMIYA
b2cc425909 Fix #5498: autodoc: unable to find type hints for a `functools.partial` 2018-10-14 16:29:04 +09:00
jfbu
7ab09b5065 Fix #3704: wrong `\label` positioning for figures with a legend 2018-10-07 10:16:11 +02:00
Takeshi KOMIYA
6eb5b29484 Merge branch 'master' into refactor_latex 2018-10-07 13:33:55 +09:00
Paul Melnikow
e792279791 Improve error message when config fails type check
The old message printed wrapped brackets around the type name, which would make you think it required an array.
2018-10-02 14:20:36 -04:00
Takeshi KOMIYA
973c3ffa25
Merge branch 'master' into change_master_doc_to_index 2018-09-29 21:12:40 +09:00
Takeshi KOMIYA
67e9f87a54
Merge branch 'master' into bytesio 2018-09-25 08:29:37 +09:00
Jon Dufresne
65da8a08ac Remove plistlib workaround for unsupported Pythons 2018-09-23 20:25:36 -07:00
Jon Dufresne
4f4e225775 Replace all six.BytesIO with io.BytesIO 2018-09-23 18:38:06 -07:00
Takeshi KOMIYA
ff8df59ac1
Merge pull request #5479 from jdufresne/https
Prefer https:// links where available
2018-09-24 09:04:54 +09:00
Jon Dufresne
dd383ec472 Prefer https:// links where available 2018-09-23 11:50:42 -07:00
Jon Dufresne
02d06bdaf0 Remove uses of six.moves that did not cause any type errors
Removal of the remaining imports may require passing "--python-version
3.5" to the mypy command.
2018-09-23 09:22:06 -07:00
Rob Ruana
e547a6a0d2
Fixes #5426: [Napoleon] Better handling of inline attributes (#5470)
* Fixes #5426: [Napoleon] Better handling of inline attributes

* Removes uneeded NOQA comments

* Fixes imports
2018-09-23 09:26:17 -04:00
Antony Lee
dbb7c38220 Rendering of exceptions by napoleon. (#4046)
This lets napoleon render exceptions using the standard info field
syntax
```
:raises FooException: Some condition.
```
rather than the nonstandard
```
:raises: :exc:`FooException` -- Some condition.
```

Note that the previous approach was more forgiving if an explanatory
text was given in the Raises section without an actual exception class:
```
Raises
------
If something occurs.
```
would be rendered as
```
:raises: *If something occurs*
```
which is OK-ish but is now rendered as
```
:raises If something occurs.:
```
which is somewhat more nonsensical.

However neither the Google style guide nor numpydoc actually support
this form (they always have both the type and the description) so I
think the change is reasonable.
2018-09-23 08:31:27 -04:00
Jon Dufresne
a3bc49dd64 Remove Python 2.6 compat shim for ElementTree.itertext 2018-09-22 10:32:28 -07:00
Takeshi KOMIYA
dc44b0d2a9 Merge branch 'master' into HEAD 2018-09-22 22:54:15 +09:00
Takeshi KOMIYA
6f25bd3680
Merge branch 'master' into drop-iteritems 2018-09-22 22:17:38 +09:00
Takeshi KOMIYA
3a2418a827 refactoring: Drop PY2 and PY3 flags 2018-09-22 21:27:59 +09:00
Takeshi KOMIYA
98648325aa Merge branch '1.8' 2018-09-22 17:16:24 +09:00
Takeshi KOMIYA
48c634e623 test: Merge py35/test_autodoc_py35.py to test_autodoc.py 2018-09-22 16:41:44 +09:00
Takeshi KOMIYA
40a2fdf315 test: Merge py3/test_util_inspect_py3.py to test_util_inspect.py 2018-09-22 16:36:10 +09:00
Takeshi KOMIYA
b18fe13f55 Drop branches for sys.version_info < (3, 4) 2018-09-22 16:31:07 +09:00
Takeshi KOMIYA
c0fffb9e8b Fix #5432: py domain: :type: field can't process :term: references 2018-09-22 15:24:14 +09:00
Takeshi KOMIYA
522105b79b Merge branch '1.8' 2018-09-20 20:01:14 +09:00
Takeshi KOMIYA
c7f3933612
Merge branch '1.8' into 5431_warnings_for_callable 2018-09-18 23:34:33 +09:00
Takeshi KOMIYA
5c3a0e4e40 Fix #5431: autodoc: `autofunction` emits a warning for callable objects 2018-09-18 13:02:01 +09:00
Takeshi KOMIYA
9e8434f902 Fix #5436: Autodoc does not work with enum subclasses with properties/methods 2018-09-18 13:01:10 +09:00
Takeshi KOMIYA
6d55e98da1 test: Move EnumCls to target.enum package 2018-09-18 13:01:10 +09:00
Takeshi KOMIYA
efdc95ef8b Merge branch '1.8' 2018-09-13 00:53:09 +09:00
Jon Dufresne
490e4aed41 Remove unnecessary object from class definitions
In Python 3, all classes are new-style classes. The object in the
definition is redundant and unnecessary.
2018-09-11 07:07:01 -07:00
Jon Dufresne
0d6be504ea Remove use of six.iteritems()
In Python 3, dict.items() is always an iterator.
2018-09-11 06:03:34 -07:00
Jon Dufresne
9d6deec4ca Fix AttributeError in ExtensionError
In Python 3, the attribute BaseException.message doesn't exist.

$ python3
>>> from sphinx.errors import ExtensionError
>>> e = ExtensionError('foo')
>>> repr(e)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sphinx/sphinx/errors.py", line 65, in __repr__
    return '%s(%r)' % (self.__class__.__name__, self.message)
AttributeError: 'ExtensionError' object has no attribute 'message'
2018-09-09 11:50:56 -07:00
Takeshi KOMIYA
ffaa528c98
Merge pull request #5390 from tk0miya/4018_htmlhelp_file_suffix
Fix #4018: htmlhelp: Add htmlhelp_file_suffix and htmlhelp_link_suffix
2018-09-09 19:35:49 +09:00
Takeshi KOMIYA
02afc357ef Merge branch '1.8' 2018-09-09 19:26:48 +09:00
Takeshi KOMIYA
d1eecb1307 Merge branch '1.7' into 1.8 2018-09-09 19:22:35 +09:00
Takeshi KOMIYA
973986cfdb Add $DO_EPUBCHECK envvar as a workaround for #4611 2018-09-09 19:09:56 +09:00
Takeshi KOMIYA
07fd1c0680 Fix #4018: htmlhelp: Add htmlhelp_file_suffix and htmlhelp_link_suffix 2018-09-08 23:11:14 +09:00
Takeshi KOMIYA
8e729b419e Fix #5399: Sphinx crashes if unknown po file exists 2018-09-08 22:21:59 +09:00