Commit Graph

2844 Commits

Author SHA1 Message Date
Takeshi KOMIYA
5e4e44c195 autodoc: Support type annotations for variables 2020-02-03 01:16:21 +09:00
Takeshi KOMIYA
179a1f9cc2 py domain: Support type annotations for variables
This adds ``:type:`` and ``:value:`` options to both ``py:data``
and ``py:attribute`` directives.  It allows to describe its
annotation in detail.
2020-02-01 12:58:27 +09:00
Takeshi KOMIYA
92c5c19f72 Merge pull request #7066 from tk0miya/6899_apidoc_private_members
Fix #6899: apidoc: private members are not shown even if --private given
2020-01-30 23:33:51 +09:00
Takeshi KOMIYA
67fefcc6f9 Merge branch '2.0' into 6418_autodoc_typehints_description 2020-01-30 23:19:45 +09:00
Takeshi KOMIYA
09cf37eebe Fix #6899: apidoc: private members are not shown even if --private given 2020-01-30 23:17:59 +09:00
Takeshi KOMIYA
dcd8f41a77 Add testcase for instance variables without defaults 2020-01-26 01:25:35 +09:00
Takeshi KOMIYA
5397664d42 Add a new extension: sphinx.ext.autodoc.typehints 2020-01-25 17:56:39 +09:00
Takeshi KOMIYA
ecf38edb43 Close #7051: autodoc: Support instance variables without defaults (PEP-526) 2020-01-25 00:57:36 +09:00
Takeshi KOMIYA
4e257a8084 Merge branch '2.0' into 7023_partial_listed_as_module_members 2020-01-19 23:09:46 +09:00
Takeshi KOMIYA
a1f6bbf800 Merge pull request #7031 from tk0miya/7023_nested_partial_functions_not_listed
#7023: autodoc: nested partial functions are not listed
2020-01-19 15:49:52 +09:00
Takeshi KOMIYA
53e38ccc30 Fix #7023: autodoc: partial functions are listed as module members 2020-01-19 15:22:09 +09:00
Takeshi KOMIYA
e908e43f67 Fix #7023: autodoc: nested partial functions are not listed 2020-01-17 09:15:45 +09:00
Takeshi KOMIYA
7906a6871e Add testcase a partialmethod not having docstring (refs: #7023) 2020-01-17 09:11:59 +09:00
Takeshi KOMIYA
ffdfb6cb87 Close #2755: autodoc: Support type_comment style annotation
Note: python3.8+ or typed_ast is required
2020-01-13 13:23:45 +09:00
Takeshi KOMIYA
729ffa1fcd Add sphinx.pycode.ast.parse() and unparse() 2020-01-13 13:15:33 +09:00
Takeshi KOMIYA
0fb3fe5fcc Merge branch '2.0' into refactor_SphinxTranslator2 2020-01-11 21:33:54 +09:00
Takeshi KOMIYA
9ed162921e autodoc: Support Positional-Only Argument separator (PEP-570 compliant) 2020-01-11 02:32:33 +09:00
Takeshi KOMIYA
6fa592f111 Merge pull request #7002 from tk0miya/refactor_Signature2
refactor: Add sphinx.util.inspect.signature()
2020-01-11 01:24:09 +09:00
Takeshi KOMIYA
35a092b7fe SphinxTranslator calls visitor/departure method for super node class 2020-01-10 22:50:43 +09:00
Takeshi KOMIYA
5867416612 refactor: Add sphinx.util.inspect.signature()
As a successor of sphinx.util.inspect.Singnature, this adds
signature() function behaves like `inspect.signature()`.  It is
very similar to way of python's inspect module.

In addition, this also adds stringify_annotation() helper to
sphinx.util.inspect module.  With these two functions, we can move
to python's Signature object to represent function signatures
perfectly.  It's natural design for python developers than ever.
2020-01-09 00:32:07 +09:00
Takeshi KOMIYA
b14439ca48 Fix #6999: napoleon: fails to parse tilde in :exc: role 2020-01-09 00:15:27 +09:00
Takeshi KOMIYA
05daa3c7ce Add sphinx.util.typing:stringify() to represent annotations as string 2020-01-05 01:13:27 +09:00
Takeshi KOMIYA
1c5a5bbbe5 Add sphinx.util.nodes:make_id() to generate better node_id 2020-01-02 22:03:39 +09:00
Takeshi KOMIYA
7123f4038a Fix #6559: Wrong node-ids are generated in glossary directive 2020-01-02 22:03:39 +09:00
Takeshi KOMIYA
eaf495c3c4 A happy new year! 2020-01-01 14:27:43 +09:00
Takeshi KOMIYA
9656b6d4dd Merge pull request #6967 from tk0miya/6966_graphviz_class
Close #6966: graphviz: Support ``:class:`` option
2019-12-29 00:25:05 +09:00
Takeshi KOMIYA
18e25d680d Close #6966: graphviz: Support `:class:` option 2019-12-27 22:38:10 +09:00
Takeshi KOMIYA
c8074b4a5d Deprecate sphinx.util:detect_encoding() and ModuleAnalyzer.encoding 2019-12-27 22:08:32 +09:00
Takeshi KOMIYA
b6244736c4 Merge pull request #6907 from kpnr/patch-2
Non-ASCII & non utf-8 charset corruption fix
2019-12-27 01:25:50 +09:00
hkm
0a982d5ebd Old get_module_source API restored, new version moved to ModuleAnalyzer class, tests updated 2019-12-25 22:29:20 +03:00
Takeshi KOMIYA
c171702ee2 Stop to use deprecated API: env.indexentries 2019-12-25 23:41:54 +09:00
Takeshi KOMIYA
72fa75cb9a Close #6837: LaTeX: Support a nested table 2019-12-22 18:00:58 +09:00
Takeshi KOMIYA
6d6fe9da0d Add IndexDomain 2019-12-22 17:20:35 +09:00
kpnr
c4e60b5b9c restore sys.path with <finally> statement 2019-12-16 21:17:16 +03:00
hkm
1ca9dacbfe Added test case for non ASCII & non UTF8 encoding Windows-1251 in test_pycode section 2019-12-15 21:47:57 +03:00
hkm
264329079b Test suite updated - encoding not detected when getting sources from native loader 2019-12-15 20:50:27 +03:00
hkm
fa5cf6fcdc lost reference to source file name fixed. Test suit updated 2019-12-15 20:28:02 +03:00
Takeshi KOMIYA
9b958f9525 Merge pull request #6925 from jdufresne/text-js
Remove redundant type="text/javascript" from <script> elements
2019-12-16 01:29:46 +09:00
Jon Dufresne
e6915baae8 Remove redundant type="text/javascript" from <script> elements
In HTML5, <script> elements default to MIME type text/javascript. The
HTML5 living standard and MDN recommend against including the attribute.

From https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type

> The HTML5 specification urges authors to omit the attribute rather
> than provide a redundant MIME type.

From https://html.spec.whatwg.org/#the-script-element

> Authors should omit the type attribute instead of redundantly setting
> it.
2019-12-15 07:52:40 -08:00
Takeshi KOMIYA
29687a29f1 Close #6446: Add sphinx.ext.durations to inspect durations of build 2019-12-16 00:47:23 +09:00
Takeshi KOMIYA
076013602b Merge pull request #6891 from jfbu/latex_6890_curlyquote
LaTeX: avoid quotes and TeX ligature replacements in PDF output
2019-12-15 23:21:55 +09:00
jfbu
30b26dd6a1 LaTeX: avoid quotes and TeX ligature replacements in PDF output
Refs: #6890

The comma character is not TeX-escaped because it is frequent in general
text and escaping it would make the LaTeX output larger for only dealing
with the problem of the LaTeX-ligature of ,, into a single character.
And one there is problem with the commas in options to Verbatim from
PygmentsBridge.

The hyphen character is escaped (not in ids and URIs!) to
\sphinxhyphen{} for both Unicode and non-Unicode engines. This is needed
to work around hyperref transforming -- and --- from section titles into
EN DASH resp. EM DASH in PDF bookmarks.

https://github.com/latex3/hyperref/issues/112

Note to expert LaTeX users: if Sphinx latex user with xelatex has

- turned off Smart Quotes for some reason,

- but does want TeX ligatures and thus overrode Sphinx
latex_elements['fontenc'] default (since #6888) to this effect,

then this should be added to LaTeX preamble:

    \def\sphinxhyphen#1{-}% (\protected is now not needed)
    \let\sphinxhyphenforbookmarks\sphinxhyphen
2019-12-15 14:19:50 +01:00
Takeshi KOMIYA
ebdd210a6b Fix #6900: sphinx-build: -D option does not considers 0 and 1 as a boolean value 2019-12-15 22:07:05 +09:00
Takeshi KOMIYA
2ae2b0d98a Merge branch '2.0' into 6632 2019-12-14 22:57:59 +09:00
Takeshi KOMIYA
0dc456fee1 refactor test: check_xpath() 2019-12-14 22:50:55 +09:00
Takeshi KOMIYA
871e0b58a8 Remove meaningless spaces 2019-12-14 22:26:17 +09:00
Takeshi KOMIYA
faedcc48cc Fix #6887: Sphinx crashes with docutils-0.16b0 2019-12-14 13:33:12 +09:00
jfbu
a0fe0aba1b Update longtable latex template 2019-12-07 00:37:33 +01:00
Takeshi KOMIYA
7292ab7eef Merge branch '2.2.2' into 2.0 2019-12-03 01:19:02 +09:00
Takeshi KOMIYA
6f529f01ed Fix #6803: Disable parallel build on macOS and py38+ 2019-12-01 16:01:19 +09:00