Commit Graph
2383 Commits
Author SHA1 Message Date
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 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