Commit Graph

3801 Commits

Author SHA1 Message Date
Takeshi KOMIYA
cd75f8fea1 Merge branch '3.x' 2021-03-27 17:33:49 +09:00
Takeshi KOMIYA
26d9a8962e Fix the testcase for linkcheck refers removed URLs
Some public URLs are disabled now.
For more details, see https://github.com/sphinx-doc/sphinx/issues/8309
2021-03-27 17:10:09 +09:00
Takeshi KOMIYA
cb654d287b Rename DocumenterBridge.filename_set to record_dependencies
DocumenterBridge.filename_set has been used since its beginning.  On the
other hand, in docutils, record_dependencies attribute is well-used to
store the list of dependency files.  So this renames it to docutils'
standard attribute.
2021-03-21 00:52:53 +09:00
Takeshi KOMIYA
5e8f814e81 Merge branch '3.x' 2021-03-20 23:25:57 +09:00
Takeshi KOMIYA
a19250b46e Fix #8959: using UNIX path separator confuses Sphinx on Windows
The first element of env.relfn2path() should be a POSIX path, not a OS
dependent path.
2021-03-20 01:32:47 +09:00
Takeshi KOMIYA
8c7e779731 Fix #8992: autodoc: Failed to resolve types.TracebackType type annotation
The builtin module, ``types.TracebackType`` does not have correct module
name.  This allows to refer it automatically.
2021-03-17 23:37:43 +09:00
Takeshi KOMIYA
3937ea816f Fix #9009: LaTeX: "release" value with underscore leads to invalid LaTeX
The "release" variable is not escaped on the LaTeX output.
2021-03-17 01:24:03 +09:00
Takeshi KOMIYA
75f5122996 Fix #7383: autodoc: Support typehints for properties
py:property directive now outputs py:property directive to describe
its type annotation.
2021-03-13 22:51:46 +09:00
Takeshi KOMIYA
204f86f736 py domain: Add py:property directive to describe a property (refs: #7068) 2021-03-11 01:56:39 +09:00
Takeshi KOMIYA
fb4220d0a2 Close #8487: csv-table now considers abspath as relpath from srcdir
To make directives' behavior consistent, the :file: option for
csv-table directive now recognizes an absolute path as a relative
path from source directory.
2021-03-09 01:07:19 +09:00
Takeshi KOMIYA
1ea11b1e48 Fix #759: autodoc: Add sphinx.ext.autodoc.preserve_defaults extension
Add a new extension `sphinx.ext.autodoc.preserve_defaults`.

It preserves the default argument values of function signatures in source code
and keep them not evaluated for readability.  This is an experimental
extension and it will be integrated into autodoc core in Sphinx-4.0.
2021-03-06 18:48:18 +09:00
Takeshi KOMIYA
0a3f897d15
Merge pull request #8432 from tk0miya/7119_pending_xref_condition
Fix #7119: Show type hint names unqualified when resolving succeeded
2021-03-06 17:32:27 +09:00
Takeshi KOMIYA
7f0b13af6e intersphinx: Support pending_xref_condition 2021-03-06 14:58:15 +09:00
Takeshi KOMIYA
930a880294 Fix #7199: py domain: Add a new confval: python_use_unqualified_type_names
Add a new config variable: python_use_unqualified_type_names.  If enabled,
it goes to suppress the module name of the python reference if it can be
resolved.
2021-03-06 14:00:00 +09:00
Jakob Lykke Andersen
72e231d0e6 C and C++, fix nested paramter lists 2021-03-04 21:28:18 +01:00
Jakob Lykke Andersen
4052cbc9b1 C++, support spaceship operator
Fixes sphinx-doc/sphinx#8942
2021-03-02 20:22:22 +01:00
Takeshi KOMIYA
fc8247a3cd
Merge pull request #8484 from tk0miya/8326_root_doc
Close #8326: Rename master_doc to root_doc
2021-02-28 17:49:32 +09:00
Takeshi KOMIYA
3059a999b2 Close #8326: Rename master_doc to root_doc
To describe the purpose more accurately, the `master_doc` is now renamed
to `root_doc`.  The old name is still available.  But it is recommeneded
to use new one from now on.
2021-02-28 17:10:57 +09:00
Takeshi KOMIYA
7d3cc382fa autodoc: an imported TypeVar is not resolved (refs: #8415)
So far, a TypeVar is rendered without module name. As a result, it
could not be resolved if it is imported from other modules.  This
prepends its module name and make it resolvable.  This is available
only in Python 3.7 or above.

As a side effect, all of TypeVars are displayed with module name. It
should be fixed in latter step (refs: #7119)
2021-02-28 15:58:06 +09:00
Takeshi KOMIYA
6d91db3b9e
Merge pull request #8927 from tk0miya/8924_TypeVar_bound
Close #8924: autodoc: Support `bound` argument for TypeVar
2021-02-26 02:00:40 +09:00
Jakob Lykke Andersen
0256daf112 C, test namespace revamp 2021-02-24 15:59:54 +01:00
Jakob Lykke Andersen
71a656498b C, simplify tests 2021-02-24 15:59:54 +01:00
Jakob Lykke Andersen
17337a3257 C, properly error on keywords as function parameters 2021-02-24 15:59:54 +01:00
Takeshi KOMIYA
a39cf57717 Close #8924: autodoc: Support bound argument for TypeVar 2021-02-24 22:51:06 +09:00
Takeshi KOMIYA
f9ca909ea0 Merge branch '3.x' 2021-02-17 00:16:32 +09:00
jfbu
19ea727f1b Adapt our tests to Pygments 2.8.0 2021-02-14 21:17:17 +01:00
Takeshi KOMIYA
def6f13d8d Merge branch '3.x' 2021-02-13 01:01:30 +09:00
Takeshi KOMIYA
7252abab1c refactor: linkcheck: Refine the constructor of Checker and CheckWorker
Make the constructors of Checker and CheckWorker classes less-coupled
with linkcheck builder.
2021-02-12 23:20:07 +09:00
Takeshi KOMIYA
5c223d20d6 refactor: linkcheck: Separate thread manager feature from builder class
To reduce the complexity of the linkcheck builder, this separates
the thread manager feature from the builder class as
HyperlinkAvailabilityChecker.
2021-02-12 23:19:01 +09:00
jfbu
b9c53c8ca6 Merge branch '3.x' into merge_3.x_into_master
Resolved Conflicts:
	sphinx/texinputs/sphinx.sty

Some hunks needed to go to sphinx/texinputs/sphinxlatexliterals.py,
others already belonged to split files.
2021-02-09 19:03:38 +01:00
jfbu
0c89c85a39 Merge branch '3.x' into latex_hyperlinked_caption_footnotes_on_3.x 2021-02-09 16:39:55 +01:00
Takeshi KOMIYA
84458da828 Merge branch '3.x' 2021-02-07 17:01:09 +09:00
jfbu
4a239bb886 Extra references to explicitly numbered footnote get page indication
To achieve this the simplest was to use also the \label/\ref mechanism
as for footnotes typeset using footnotetext. Removing the hack into
footnotehyper internal macro, we use an enriched scope, which will
enable references with same number to each generate correct links.
2021-02-06 22:00:47 +01:00
jfbu
6275a7756f Use \thesphinxscope mark-up (shorter, and may help trick for page scope) 2021-02-06 13:43:12 +01:00
jfbu
628c58abef Prepare for scope-limited footnote numbering 2021-02-06 10:45:50 +01:00
jfbu
a0b0a08e38 LaTeX footnotes from caption titles now hyperlinked in PDF
This is fifth item of #2616
2021-02-05 16:45:12 +01:00
Takeshi KOMIYA
f02fb7a8cc refactor: linkcheck: Separate worker feature from builder class
To reduce the complexity of the linkcheck builder, this separates
the worker feature from the builder class.
2021-02-05 22:52:28 +09:00
jfbu
87fa272763 Merge branch '3.x' into merge_3.x_into_master
Resolved Conflicts:
	sphinx/texinputs/sphinxpackagefootnote.sty
2021-02-04 16:31:45 +01:00
Takeshi KOMIYA
284d9e703b refactor: Fix the right hand value of autodoc options should be None 2021-02-04 22:35:29 +09:00
Takeshi KOMIYA
0d50b97fa3
Merge pull request #8297 from pbudzyns/exclude-members-fix
Local autodoc options override or extend autodoc_default_options.
2021-02-04 22:24:52 +09:00
jfbu
fbafb308b8 Merge branch '3.x' into master_with_merged_3.x 2021-02-02 18:01:55 +01:00
jfbu
7c7032dd05 Extend latex footnotes unit test 2021-02-02 00:10:45 +01:00
Takeshi KOMIYA
f803266d63
Merge pull request #8805 from tk0miya/8775_workaround
Fix #8775: Avoid the crash of autodoc caused by type union operator
2021-02-01 21:35:04 +09:00
Takeshi KOMIYA
223f59b3c5
Merge pull request #8802 from tk0miya/8775_pydomain_pep604
py domain: Support type union operator (PEP-604) (refs: #8775)
2021-02-01 21:22:38 +09:00
Takeshi KOMIYA
7ca5248057 Fix #8775: Avoid the crash of autodoc caused by type union operator
The type union operator (PEP-604) causes autodoc crashed in python 3.9
or below because of the syntax is not suppoerted yet in the interpreters.
Internally, `typing.get_type_hints()` raises TypeError on evaluating the
annotation by BitOr operator for types.

To avoid the crash, this adds a fallback not to evaluate the annotations
and keep as is.  As a side effect, `autodoc_type_aliases` will not work
for the modules and classes that uses type union operator for their
annotations.
2021-02-01 21:21:56 +09:00
Takeshi KOMIYA
2956f19674
Merge pull request #8803 from tk0miya/8775_autodoc_type_union_operator
autodoc: Support type union operator (PEP-604) (refs: #8775)
2021-02-01 21:19:45 +09:00
Takeshi KOMIYA
2c2b8c1154 py domain: Support type union operator (PEP-604) (refs: #8775)
Upgrade annotation parser for python domain to support type union
operator introduced in PEP-604.  It's available on all python
interpreters.
2021-02-01 21:12:29 +09:00
Takeshi KOMIYA
6d8c9183fa Fix #8800: autodoc: Uninitialized attributes in superclass are recognized as undocumented
Unintentionally, uninitialized attributes defined at superclasses are
recognized as undocumented in the filtering step.  Therefore, they are
filtered if `:undoc-members:` option given.
2021-02-01 21:06:07 +09:00
pbudzyns
fd6587d5e9 rebase and fix tests 2021-02-01 10:58:09 +01:00
pbudzyns
270921d73a Merge remote-tracking branch 'upstream/3.x' into exclude-members-fix 2021-02-01 10:46:44 +01:00
pbudzyns
8d380cadc7 check if autodoc_defaults are str, fix tests 2021-02-01 09:46:19 +01:00
Takeshi KOMIYA
af6ed52ca1
Merge branch '3.x' into 8446_escape_spaces_inside_desc_signatures 2021-02-01 01:24:02 +09:00
Takeshi KOMIYA
7318d1dfd4 autodoc: Support type union operator (PEP-604) (refs: #8775)
Upgrade autodoc to support type union operator introduced in
PEP-604. It's available only with python 3.10+.
2021-01-31 23:38:36 +09:00
jfbu
e77378da1c Merge branch '3.x' 2021-01-30 21:18:00 +01:00
jfbu
5b6a273825 Let latex writer line trimming from depart_entry() work as before #8781
This is cosmetic as the blank line starting varwidth environment used
for merged table cells in latex output changed nothing to PDF.

Nevertheless I extended a unit test to have a multi-paragraph merged
cell using varwidth. What is important is that \sphinxAtStartPar line
itself is never followed by blank line.
2021-01-30 10:26:42 +01:00
Takeshi KOMIYA
339ce2f894 Merge branch '3.x' 2021-01-30 11:49:08 +09:00
Jean-François B
879bf54a05
Merge pull request #8781 from jfbu/latex_hyphenation_of_first_word
Fix #8780: long words in narrow columns may not be hyphenated
2021-01-29 20:57:54 +01:00
jfbu
d6e11b89e9 Fix suppression of needed whiteline, encapsulate into \sphinxAtStartPar
Define it to do nothing with lualatex engine
2021-01-29 10:40:50 +01:00
jfbu
185a2d27fe Fix #8780: long words in narrow columns may not be hyphenated
This is done by adding '\hskip0pt\relax\n' whenever a paragraph starts.
2021-01-29 00:24:44 +01:00
Takeshi KOMIYA
57126d9ee2
Merge pull request #8773 from francoisfreitag/app-build
Linkcheck: Use app.build() to trigger the test build
2021-01-28 23:28:31 +09:00
François Freitag
c7eb7cd127
Linkcheck: Use app.build() to trigger the test build
Instead of using application members to access the builder and trigger a
build, use the main app interface.
It ensures the builder setup is realistic, builder cleanups are executed
and the build-finished events are emitted.
2021-01-27 18:55:36 +01:00
Takeshi KOMIYA
c9480f9943 Merge branch '3.x' 2021-01-28 00:56:46 +09:00
Takeshi KOMIYA
241577f65e Merge branch '8137_urldecode' into 3.x 2021-01-26 02:11:13 +09:00
Takeshi KOMIYA
84dc65ad51 html: html_codeblock_linenos_style defaults to 'inline' (refs: #7849)
As discussed in #7879, the default style of line numbers for code
blocks in HTML output becames 'inline' by default.  And 'table' style
is now deprecated and will be removed in Sphinx-6.0.
2021-01-26 01:42:17 +09:00
pbudzyns
ac5079ed85 redundant '+' has no effect 2021-01-25 16:07:18 +01:00
pbudzyns
381e30c23b add more extendable options and tests 2021-01-25 13:24:01 +01:00
pbudzyns
7348ba8d60 add more extendable options and tests 2021-01-25 13:15:13 +01:00
pbudzyns
0a85b4148e add more extendable options and tests 2021-01-25 12:54:08 +01:00
Takeshi KOMIYA
8203642c41
Merge pull request #8752 from tk0miya/1638_permalinks_for_glossary_terms
Close #1638: html: Add permalink icons to glossary terms
2021-01-25 20:35:44 +09:00
Takeshi KOMIYA
16a8a17779
Merge pull request #8747 from tk0miya/8134_args_for_mock_decorator
Fix #8134: autodoc: crashes when mocked decorator takes arguments
2021-01-25 20:33:40 +09:00
Takeshi KOMIYA
949ec8737f Close #1638: html: Add permalink icons to glossary terms 2021-01-24 23:35:37 +09:00
Takeshi KOMIYA
502c4ee5fb Merge branch '3.x' 2021-01-24 14:32:13 +09:00
Takeshi KOMIYA
a78c6b799f Fix #8134: autodoc: crashes when mocked decorator takes arguments
autodoc crashed when a decorator in mocked module takes arguments
because mock system returns the first argument for the decorator as a
decorated object.

This changes the approach for mocking decorators that remembers
arguments for each decoration, and fetch the latest argument on
generating document.
2021-01-24 14:18:00 +09:00
Takeshi KOMIYA
15cbc6dbb0 Close #6550: html: Allow to use HTML permalink texts
Add new configuration variables: `html_permalinks` and
`html_permalinks_icon`.

This refines the settings around HTML permalinks.

* html_add_permalinks
  * Deprecated.
* html_permalinks
  * Enable or disable permalinks feature.
* html_permalinks_icon
  * Change the icon for permalinks
2021-01-24 14:17:07 +09:00
Takeshi KOMIYA
97f54bdf31
Merge pull request #8733 from tk0miya/update_underscore.js-1.12.0
Update Underscore.js to 1.12.0
2021-01-24 14:07:16 +09:00
Takeshi KOMIYA
deda1918fc
Merge pull request #8731 from tk0miya/8004_preprocess_types_for_google
Fix #8004: napoleon_preprocess_types for Google style docstrings
2021-01-24 13:59:21 +09:00
Takeshi KOMIYA
2522b61185
Merge pull request #8729 from tk0miya/8727_namespace_subpackage
Fix #8727: apidoc: namespace module file is not generated if no submodules
2021-01-24 13:58:33 +09:00
jfbu
2e22bd0a23 Merge branch 'master' into latex_font_for_pdflatex 2021-01-23 09:13:08 +01:00
Takeshi KOMIYA
af0dfa20d0
Merge pull request #8247 from silene/inter_prodlist_refs
Allow production lists to refer to tokens from other production groups.
2021-01-23 17:07:52 +09:00
Guillaume Melquiond
ffacb2ca18 Add testcase. 2021-01-23 08:57:36 +01:00
Takeshi KOMIYA
1b4265da4d Update Underscore.js to 1.12.0 2021-01-23 16:41:59 +09:00
Takeshi KOMIYA
440e64a91b Fix #8004: napoleon_preprocess_types for Google style docstrings
Type definitions in Google style docstrings are rendered as references
when :confval:`napoleon_preprocess_types` enabled.
2021-01-23 14:20:19 +09:00
Takeshi KOMIYA
650f8ea237 Fix #8727: apidoc: namespace module file is not generated if no submodules
sphinx-apidoc should generate a namespace module file when
`--implicit-namespace` option given.  This fixes the case the namespace
module has subpackages, but no submodules.
2021-01-23 00:40:16 +09:00
Takeshi KOMIYA
5ce72f465b Merge branch '3.x' 2021-01-22 22:52:32 +09:00
Takeshi KOMIYA
a71028bf9e
Merge pull request #8719 from tk0miya/8714_kbd_capslock
Fix #8714: html: kbd role with "Caps Lock" rendered incorrectly
2021-01-22 22:07:06 +09:00
Takeshi KOMIYA
d6f41227d7 Fix #8714: html: kbd role with "Caps Lock" rendered incorrectly
`:kbd:` role has to support keys in consist of multiple words (ex. caps
lock, num lock, etc.)
2021-01-22 21:58:19 +09:00
Takeshi KOMIYA
5260143afe Fix #8704: viewcode: anchors are generated in incremental build
The anchors for viewcode was generated in the reading phase only if
supported builder is used.  It causes anchors are missing on the
incremental build after the build for non supported builder.

This introduces `viewcode_anchor` node to insert the anchor even if non
supported builders.  They will be converted to the anchor tag in the
resolving phase for supported builders.  Or, they will be removed for
non supported builders.
2021-01-22 21:41:42 +09:00
Takeshi KOMIYA
d5d072bc3a Merge branch '3.4.x' into 3.x 2021-01-22 21:40:27 +09:00
Takeshi KOMIYA
b2bb12ad91 Fix #8720: viewcode: module pages are generated for epub on incremental build
The module pages should be generated for epub only if enabled via
configuration.  But they are generated after the build for other
viewcode-supported builders.  This checks the current builder on
generating module pages.
2021-01-22 00:51:21 +09:00
jfbu
99a8b7f37f LaTeX: update default font configuration
This replaces times package with tgtermes and tgheros (clones of Times and
Helvetica with better LaTeX support) and the monospace font from txfonts
package (txtt). This font is better matched with Times-like fonts than
Courier clones.

The changes applies to pdflatex/platex/uplatex.

Fixes: #8711
2021-01-20 23:03:08 +01:00
Takeshi KOMIYA
73db152cf6 Close #5560: napoleon_use_param also affect "other parameters" section 2021-01-20 23:21:11 +09:00
Takeshi KOMIYA
cead0f6ddf linkcheck: Fix race condition that could lead to checking the availability of the same URL twice
So far, linkcheck scans all of references and images from documents, and
checks them parallel.  As a result, some URL would be checked twice (or
more) by race condition.

This collects the URL via post-transforms, and removes duplicated URLs
before checking availability.

refs: #4303
2021-01-20 20:58:27 +09:00
Takeshi KOMIYA
ca0677086d
Merge pull request #8658 from SolidifiedRay/feature-custom-section
Close #8573: napoleon: Add more custom section styles
2021-01-19 21:13:13 +09:00
SolidifiedRay
7ad85cd1e0 Close #8573: napoleon: Add more custom section styles 2021-01-18 11:43:40 -08:00
Takeshi KOMIYA
bc56384fb9 Fix #1112: download role creates duplicated copies
`:download:` role creates duplicated copies when the document contains
two or more the role for the same file, but in different form.  It
considers two paths are different when one contains relative path like
`path/to/../file.dat`.

Internally, `env.relfn2path()` does not normalize the given path in
relative form.  As a result, download role can't detect the same paths
are given.  This adds `os.path.normpath()` to `env.relfn2path()` to
normalize the path.
2021-01-19 02:27:20 +09:00
Takeshi KOMIYA
9ced1e355a refactor: test: Do not use deprecated function: execfile_() 2021-01-17 18:39:27 +09:00
Takeshi KOMIYA
d88166e84b Close #8514: autodoc: Default values of overloads are taken from actual implementation
As a well-known idiom, mypy recommends to use ellipsis ("...") for
default argument values as a elided style.  This allows to write the
style and helps to document it with copying the default argument
values from actual implementation.

Note: This does not copy the default argument value when the argument
of overloaded function has its own default value.
2021-01-17 02:32:50 +09:00
Takeshi KOMIYA
425cd1af02 Fix #8693: autodoc: Default values for overloads are rendered as string
The default values for overloaded functions are rendered as string
literal unexpectedly because autodoc extracts code snippets from
the source code, not actual value (ex. int, ellipsis, and so on).

This introduces a simple wrapper class; `DefaultValue` to render these
code snippets like actual values, not string literals.
2021-01-17 02:30:20 +09:00
Takeshi KOMIYA
30f8640bab Merge branch '3.x' 2021-01-16 21:51:46 +09:00
Takeshi KOMIYA
d635d94eeb
Merge pull request #8685 from tk0miya/8683_strftime_z
Fix #8683: html_last_updated_fmt does not support UTC offset (%z)
2021-01-14 01:11:24 +09:00
Takeshi KOMIYA
b742bde8e6
Merge pull request #8684 from tk0miya/2030_automatic_dedent
Fix #2030: automatic dedent support in code-block directive
2021-01-14 01:11:02 +09:00
Takeshi KOMIYA
fddc42847f Fix #2030: automatic dedent support in code-block directive 2021-01-13 01:10:28 +09:00
Takeshi KOMIYA
233e359330
Merge pull request #8679 from tk0miya/8651_xref_for_rubric
Fix #8651: cross-reference for a rubric having inline item is broken
2021-01-13 01:01:36 +09:00
Takeshi KOMIYA
8ff8b5532c Fix #8683: html_last_updated_fmt generates wrong time zone for %Z
sphinx.util.i18n:format_date() converts '%Z' to full name of time zone
unexpectedly.  It should be converted to short name.
2021-01-13 00:50:01 +09:00
Takeshi KOMIYA
d5559e1ba2 Fix #8683: html_last_updated_fmt does not support UTC offset (%z)
sphinx.util.i18n:format_date() does not support %z so far.  This
adds a mapping for %z to the babel form 'ZZZ'.
2021-01-13 00:49:59 +09:00
Jakob Lykke Andersen
f7a1d66359 C++, fix object types for xrefs
Make them all work with intersphinx.
Strengthen templateParam a bit.
2021-01-11 20:51:36 +01:00
Jakob Lykke Andersen
750e6ec431 C, fix object types for xrefs
Add 'identifer' to all and 'type' to types.

Fixes sphinx-doc/sphinx#8341
2021-01-11 20:51:36 +01:00
Takeshi KOMIYA
12ec8f0cae Fix #8651: cross-reference for a rubric having inline item is broken
The implementation of the standard domain so far has considered the
first child of the rubric node is the title of the rubric.  But it can
may multiple nodes when the rubric title is marked up.

This extracts the title of the rubric from the whole of the children
of it.
2021-01-11 22:50:45 +09:00
Takeshi KOMIYA
b372a99c01
Merge pull request #8674 from tk0miya/207_multiple_highlight_options
Close #207: Now highlight_language supports multiple languages
2021-01-11 21:49:29 +09:00
Takeshi KOMIYA
32ac5f2e57 Close #207: Now highlight_language supports multiple languages
This changes the structure of `highlight_options` to a dictionary that
maps language names to option dictionary.  It allows to setting pygments
options for multiple languages at once.
2021-01-11 21:40:09 +09:00
Takeshi KOMIYA
a3df1d00c7 test: Add testcase for relative/short xref for py domain 2021-01-11 03:12:39 +09:00
Jakob Lykke Andersen
8a11f909a7 C, fix namespace lookup for expr role 2021-01-10 12:35:28 +01:00
Takeshi KOMIYA
5460ea103b Merge branch '3.x' 2021-01-08 01:23:17 +09:00
Takeshi KOMIYA
af4e615a8a Close #6241: html: Allow to add JS/CSS files to the specific page
Allow to add JS/CSS files to the specific page when an extension calls
`app.add_js_file()` or `app.add_css_file()` on `html-page-context`
event.
2021-01-07 02:12:07 +09:00
Takeshi KOMIYA
5ba5602d71
Merge pull request #8638 from tk0miya/5977_dont_link_var_field
Close #5977: :var: field do not create a cross-reference …
2021-01-06 01:00:12 +09:00
Takeshi KOMIYA
5b392e3951 refactor: Move CSS tags in basic/layout.html to `css_files` variable
To make CSS customizable, all CSS files in basic/layout.html has their
priority: 200.  Therefore, extensions and users can insert their own
custom CSS files before or just after them.

As a side effect, the CSS tags in basic/layout.html are removed.  These
CSS files will be rendered via `css_files` template variable.

refs: #8634, c5f0398010
2021-01-03 02:41:17 +09:00
Takeshi KOMIYA
a9c7dd7037 Merge branch '3.x' 2021-01-03 00:20:27 +09:00
Takeshi KOMIYA
e9a4ebf70d doc: Add explanation for the priority attribute of html_*_files 2021-01-03 00:16:10 +09:00
Takeshi KOMIYA
c5f0398010 Close #8634: html: Allow to change the order of JS/CSS
`Sphinx.add_js_file()` and `Sphinx.add_css_file()` take `priority`
argument to change the order of JS/CSS files.
2021-01-02 02:06:34 +09:00
Takeshi KOMIYA
918086b559 Close #5977: :var: field do not create a cross-reference
Since its beginning, `:var:` field has created a cross-reference to the
attribute having the same name.  It is meaningful only if the attribute
is documented by `py:attribute` directive.  It means the `:var:` field
and `:attr:` role are almost the same and conflicted.  Additionally,
the cross-reference points incorrect variable if the target is not
documented.

Thus, the cross-reference feature of `:var:` field is disabled.
2021-01-01 22:53:23 +09:00
Takeshi KOMIYA
9cac2001f7 test: py domain: Add a testcase for :var: field 2021-01-01 18:15:42 +09:00
Takeshi KOMIYA
4b452338f9 Merge branch '3.x' 2021-01-01 13:57:19 +09:00
Takeshi KOMIYA
7ecf6b88aa Merge branch '3.4.x' into 3.x 2021-01-01 13:56:19 +09:00
Takeshi KOMIYA
1544097af5 Merge branch '3.x' 2021-01-01 13:55:12 +09:00
Takeshi KOMIYA
f996859420 A happy new year!
.. note::

   $ find sphinx tests LICENSE doc/conf.py -type f -exec sed -i '' -e 's/2007\-20../2007-2021/' {} \;
   $ git co sphinx/locale/**/*.js sphinx/templates/epub3/mimetype
2021-01-01 13:40:48 +09:00
Takeshi KOMIYA
b2c9297bd2
Merge pull request #8627 from tk0miya/8315_struct.Struct
Fix #8315: autodoc: Failed to resolve struct.Struct type annotation
2021-01-01 13:13:11 +09:00
Takeshi KOMIYA
663074e3ce
Merge pull request #8626 from tk0miya/refactor_test_autosummary
refactor: test: Use rollback_sysmodules fixture in test_ext_autosummary
2021-01-01 13:12:35 +09:00
Takeshi KOMIYA
05b67f2a3e
Merge pull request #8633 from tk0miya/merge_3.4.x
Merge 3.4.x to 3.x
2021-01-01 13:11:56 +09:00
Takeshi KOMIYA
9ec65ff039 Merge branch '3.4.x' into merge_3.4.x 2020-12-31 21:33:43 +09:00
Takeshi KOMIYA
2eb8927b89 Fix test: missing compound class for kbd tag 2020-12-31 21:20:38 +09:00
Takeshi KOMIYA
b31b8df9bf
Merge pull request #8620 from tk0miya/8619_compound_kbd
Close #8619: html: kbd role generates customizable HTML tags for compound keys
2020-12-31 21:11:42 +09:00
Takeshi KOMIYA
62a0ee3fef Merge branch '3.x' 2020-12-31 14:33:09 +09:00
Takeshi KOMIYA
f1a051fdfc Fix #8315: autodoc: Failed to resolve struct.Struct type annotation
The builtin module, ``struct.Struct`` does not have correct module
name since Python 3.8.  This allows to refer it automatically.
2020-12-31 14:25:05 +09:00
Takeshi KOMIYA
54e8b8d9bc refactor: test: Use rollback_sysmodules fixture in test_ext_autosummary 2020-12-31 10:55:45 +09:00
Takeshi KOMIYA
e3b1fdeeeb
Merge branch '3.4.x' into 8602_process-docstring_for_nondatadescriptors 2020-12-31 10:13:03 +09:00
Takeshi KOMIYA
6a53c53d53 Fix #8618: html: incorrect HTML for single compound-kdb separators 2020-12-30 21:12:00 +09:00
Takeshi KOMIYA
8e5f4e5616 Close #8619: html: kbd role generates customizable HTML tags for compound keys 2020-12-30 20:36:09 +09:00
Takeshi KOMIYA
a122397b4b Merge branch '3.x' 2020-12-29 18:37:45 +09:00
Takeshi KOMIYA
3f7bf48715 Merge branch '3.4.x' into 3.x 2020-12-29 18:33:36 +09:00
Takeshi KOMIYA
97f36a2d02 Fix #8602: autodoc: The `autodoc-process-docstring` event is emitted to the non-datadescriptors unexpectedly 2020-12-29 18:04:24 +09:00
Takeshi KOMIYA
85567748d9 Fix #8164: autodoc: Classes that inherit mocked class are not documented
Use ismock() to check a module member is a mocked or not. It allows not
to skip subclasses of mocked class.
2020-12-29 00:26:23 +09:00
Takeshi KOMIYA
476169284d autodoc: Add a helper that checks the object is mocked; ismock() 2020-12-28 21:50:36 +09:00
Takeshi KOMIYA
05518851d3
Merge branch '3.x' into 8306_autosummary_mocks_are_documented 2020-12-28 17:25:09 +09:00
Takeshi KOMIYA
0d84818739 Fix #8594: autodoc: empty __all__ attribute is ignored
An empty `__all__` should be represented as "there is no public items".
But autodoc considers all items on the module are public.  This changes
the behavior to correct one.
2020-12-28 13:53:56 +09:00
Takeshi KOMIYA
b19bce971e
Merge pull request #8593 from tk0miya/8592_meta_public_doesnt_affect_to_variables
Fix #8592: autodoc: `:meta public:` does not effect to variables
2020-12-28 13:51:50 +09:00
Takeshi KOMIYA
556b9743fe
Merge pull request #8596 from tk0miya/8022_meta_hide_value
Close #8022: autodoc: Allow to hide the value of the variables via metadata
2020-12-28 12:15:56 +09:00
Takeshi KOMIYA
ce52a90d92 Fix #8592: autodoc: :meta public: does not effect to variables
To control the visibility of variables, ModuleDocumenter have to load
docstring of them on `get_object_members()` phase.  This reimplements
it and `get_module_members()` helper to fetch docstring on earlier
phase (as ClassDocumenter does).
2020-12-27 22:21:34 +09:00
Takeshi KOMIYA
c86e92cb95 Fix #8306: autosummary: mocked modules are documented as empty page
The :recursive: option for autosummary directive creates an empty page
for mocked modules unexpectedly.  This make them ignored.
2020-12-27 21:45:15 +09:00
Takeshi KOMIYA
9e9e486e65 Close #8022: autodoc: Allow to hide the value of the variables via metadata
autodata and autoattribute directives does not show right-hand value of
the variable if its docstring contains ``:meta hide-value:`` in
info-field-list.
2020-12-27 12:46:03 +09:00
Takeshi KOMIYA
6c645e41f8 refactor: Deprecate no_docstring argument for Documenter.add_content()
Deprecate `no_docstring` argument for `Documenter.add_content()` again.

At the first trial (#8533), it changes the behavior of
`autodoc-process-docstring` event; it is emitted unexpectedly for an
alias of class.  But it brings an incompatible change to extensions.
Hence it was partially reverted at #8581.

This keeps not calling the event for an alias of class.  To do that,
now `Documenter.get_doc()` can return None value.
2020-12-26 21:14:26 +09:00