Commit Graph

12048 Commits

Author SHA1 Message Date
Takeshi KOMIYA
74f7689a70
Merge pull request #5651 from tk0miya/add_typehints_to_writers
Add better type annotations to writers
2018-11-21 10:00:24 +09:00
Takeshi KOMIYA
f128be573b Update type hints to text writer 2018-11-21 01:37:48 +09:00
Takeshi KOMIYA
42193dc581 Update type hints to texinfo writer 2018-11-21 01:37:48 +09:00
Takeshi KOMIYA
685dac96ca Update type hints to manpage writer 2018-11-21 01:37:48 +09:00
Takeshi KOMIYA
b3f085aa08 Update type hints to LaTeX writer 2018-11-21 01:37:48 +09:00
Takeshi KOMIYA
a608f7e725 Update type hints to HTML5 writer 2018-11-21 01:10:25 +09:00
Takeshi KOMIYA
c0f52fddd0 Update type hints to HTML4 writer 2018-11-21 01:10:12 +09:00
Takeshi KOMIYA
e46d14d506
Merge pull request #5649 from tk0miya/fix_annotations_latex_writer
Fix type annotations for LaTeX writer
2018-11-21 01:02:29 +09:00
Takeshi KOMIYA
d92fd2c787
Merge pull request #5638 from tk0miya/5385_master_doc_migrator
Add a handler to migrate master_doc from "contents" to "index" (refs: #5385)
2018-11-21 01:01:55 +09:00
Takeshi KOMIYA
1bd214b1a1
Merge pull request #5596 from cocoatomo/xrefrole-constructor
Simplify XRefRole constructor
2018-11-21 00:50:14 +09:00
Takeshi KOMIYA
1e700fa70c Add a handler to migrate master_doc from "contents" to "index" 2018-11-21 00:32:36 +09:00
Takeshi KOMIYA
5c6def439b
Merge pull request #5639 from stephenfin/text-writer-nits
Fix two nits with the TextBuilder class
2018-11-21 00:31:06 +09:00
Takeshi KOMIYA
34b690a577 Fix type annotations for LaTeX writer 2018-11-21 00:24:05 +09:00
Takeshi KOMIYA
5d2d4e0477
Merge pull request #5642 from jdufresne/typed
Drop explicit dependency: typed_ast
2018-11-20 23:14:37 +09:00
Takeshi KOMIYA
85dcb3d3e7
Merge pull request #5643 from stephenfin/doc-rework
Doc rework (user guide, part 5)
2018-11-20 23:03:48 +09:00
jfbu
f42d344e2c LaTeX: update sphinx.sty version and date 2018-11-18 10:16:30 +01:00
Jean-François B
9c8c2101d7
Merge pull request #5630 from jfbu/5520_latex_caption_package
LaTeX: compatibility with caption package
2018-11-18 10:11:04 +01:00
jfbu
cdb70a1dde LaTeX: add a comment 2018-11-18 10:00:23 +01:00
jfbu
15cf5ff09a LaTeX: compatibility with captions package, last part
Make sure vertiale spacing is the same for tabular(y)/longtable
also for multi-line captions
2018-11-18 09:47:01 +01: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
6283324b1a Load CMU by filename, not font name, for XeLaTeX 2018-11-17 01:46:18 +01:00
jfbu
f56431b687 Fix flake8 2018-11-17 00:41:53 +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
Stephen Finucane
1c07f0004f doc: Add "theming" to usage guide
This one is a little unusual. The current theming doc mixes user-focused
documentation with developer-focused documentation. This is confusing
and unnecessary. Resolve the issue by splitting the doc in two. The
user-focused docs are moved to the advanced section of the usage guide,
while the developer docs remain where they are, pending the addition of
a developer guide.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 15:23:33 +01:00
Jon Dufresne
3bc938ceba Drop explicit dependency: typed_ast
typed-ast has been a required dependency of mypy since v0.470. Can rely
on it being installed as a transient dependency and not list it
explicitly. For the change in mypy, see:

a207754a7e
2018-11-16 05:23:56 -08:00
Stephen Finucane
356ebd5596 doc: Rework "theming" document
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 13:33:36 +01:00
Stephen Finucane
71e8477597 doc: Add "websupport" to usage guide
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 13:23:06 +01:00
Stephen Finucane
e766336a2b doc: Rework "websupport" documents
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 13:23:01 +01:00
Stephen Finucane
23afd29cbb doc: Add "setuptools" to usage guide
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 13:22:38 +01:00
Stephen Finucane
d380617c3b doc: Add "internationalization" to the usage guide
This is added to the new "advanced" subsection.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 13:20:46 +01:00
Stephen Finucane
b7ff889050 doc: Rework "internationalization" document
Shuffle some things around, add some additional markup, and fix header
styles.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 12:42:27 +01:00
Stephen Finucane
ac9f6a8b05 Fix two nits with the TextBuilder class
- 'logger' was unused and can be removed
- 'TextTranslator.sectionchars' was overridden in '__init__' and doesn't
  need to be defined

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-11-16 11:15:05 +01:00
cocoatomo
212ecd203d Partially revert "Simplify XRefRole constructor" 2018-11-16 16:51:56 +09:00
Takeshi KOMIYA
bcf7f9f8eb
Merge pull request #5628 from tk0miya/5627_qthelp
Fix #5627: index.html missing in QtHelp
2018-11-14 23:45:45 +09: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
Takeshi KOMIYA
3a81caf148
Merge pull request #5631 from jdufresne/dict
Always prefer dict literals over calls to dict()
2018-11-14 20:04:12 +09:00
Takeshi KOMIYA
4fd14cf5e1
Merge pull request #5632 from jdufresne/super-json
Use super() in SphinxJSONEncoder
2018-11-14 20:02:04 +09:00
Takeshi KOMIYA
19b1078f6d
Merge pull request #5633 from jdufresne/js-test
Improve JS handling in test_search.py
2018-11-14 20:01:13 +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
8c46a94bca Use super() in SphinxJSONEncoder
This case was missed as part of
710ca3d7c3.
2018-11-13 21:22:30 -08:00
Jon Dufresne
1ae049b2ee Always prefer dict literals over calls to dict()
Dict literals are always slightly faster and are idiomatic modern
Python.
2018-11-13 18:44:16 -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
Takeshi KOMIYA
45ad2e41a5
Merge pull request #5610 from tk0miya/refactor_domains
Refactor std domain: Add add_object() and add_program_option()
2018-11-14 00:55:06 +09:00
Takeshi KOMIYA
c80b5fe58f
Merge pull request #5606 from sphinx-doc/fix_typehints3
Fix type annotations for RoleFunction
2018-11-14 00:53:28 +09:00
Takeshi KOMIYA
d5e4bc0e75
Merge pull request #5622 from jdufresne/inval
Fix "invalid escape sequence" warnings emitted during tests
2018-11-14 00:47:44 +09:00
Takeshi KOMIYA
a6fc9259b0
Merge pull request #5620 from jdufresne/dep-force-decode
Deprecate and drop internal use of force_decode()
2018-11-14 00:47:41 +09: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