Commit Graph
4860 Commits
Author SHA1 Message Date
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 86c75cea13 Merge pull request #8721 from tk0miya/8720_viewcode_incremental_build
Fix #8720: viewcode: module pages are generated for epub on incremental build
2021-01-22 21:14:00 +09:00
François Freitag aa5e4e2da0 Deprecate linkcheck builder {broken,good,redirected}
These attributes were used to cache checked links and avoid issuing
another web request to the same URI.

Since 82ef497a8c, links are pre-processed
to ensure uniqueness. This caching the results of checked links is no
longer useful.
2021-01-21 17:06:51 +01: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
Takeshi KOMIYA 82ef497a8c Merge pull request #8702 from tk0miya/4304_linkcheck_same_url
linkcheck: Do not check the availability of the same URL repeatedly
2021-01-20 21:12:22 +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 8a0ec3b7a4 Merge pull request #8708 from tk0miya/refactor_autosummary
refactor: autosummary: Deprecate _simple_info() and _simple_warn()
2021-01-20 20:53:53 +09:00
Jakob Lykke Andersen 67c4ca6b21 Merge pull request #8706 from jakobandersen/cpp_operator
C++, also hyperlink operators in expr and alias
2021-01-19 19:04:13 +01:00
Takeshi KOMIYA d49f3a1c78 refactor: autosummary: Deprecate _simple_info() and _simple_warn() 2021-01-20 02:23:34 +09:00
Jakob Lykke Andersen ab7562513b C++, also hyperlink operators in expr and alias 2021-01-19 17:45:28 +01:00
Takeshi KOMIYA ef7f57325c Update CHANGES for PR #8658 2021-01-19 21:17:26 +09:00
Takeshi KOMIYA 40f2c832ff Merge pull request #8698 from tk0miya/8681_viewcode_incremental_build
Close #8681: viewcode: Support incremental build
2021-01-19 02:42:21 +09:00
Takeshi KOMIYA 2e01c34acf Close #8681: viewcode: Support incremental build
Now viewcode supports incremental build. It generates HTML files only
when the original python code is updated from last build.
2021-01-19 02:30:11 +09: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 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 90ab89311f Merge pull request #8667 from tk0miya/8652_invalid_type_comments
Fix #8652: autodoc: variable comments are ignored if invalid type comments found
2021-01-16 21:40:34 +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 6101077aab Merge pull request #8680 from tk0miya/deprecate_DocumenterBridge.reporter
refactor: Deprecate DocumenterBrdige.reporter
2021-01-13 01:08:45 +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 88102c5188 Update CHANGES 2021-01-11 20:52:02 +01:00
Takeshi KOMIYA dffb565eea refactor: Deprecate DocumenterBrdige.reporter
The logging system of Sphinx was migrated to sphinx.util.logging now.
So it's time to deprecate reporter interface for Documenters.
2021-01-12 01:48:16 +09: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 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 d7cdb9e22d Fix #8671: highlight_options is not working
Sadly HTML and LaTeX writers compares the highlight languages using
`is` operator.  As a result, it has not worked even if languages are
same.  This replaces the comparison operator by `==`.
2021-01-11 20:37:05 +09:00
Jakob Lykke Andersen 8a11f909a7 C, fix namespace lookup for expr role 2021-01-10 12:35:28 +01:00
Takeshi KOMIYA eaa8612567 Fix #8652: autodoc: variable comments are ignored if invalid type comments found
To avoid the crash of ModuleAnalyzer from invalid type comments, this
start to retry parsing without type_comments=False when `ast.parse()`
raises SyntaxError.
2021-01-10 17:08:56 +09:00
Takeshi KOMIYA 7acafa991b Update CHANGES for PR #8665 2021-01-10 15:04:59 +09:00
Takeshi KOMIYA d9569a84a2 Merge branch '3.4.x' into 3.x 2021-01-08 01:18:53 +09:00
Takeshi KOMIYA 458ccbea0b Bump version 2021-01-08 01:17:58 +09:00
Takeshi KOMIYA 55cdadf973 Bump to 3.4.3 final 2021-01-08 01:16:15 +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 a51c8a5652 Fix #8655: autodoc: Crashes when object raises an exception on hasattr()
autodoc crashes when the target object raises an exception on
`hasattr()`.  The `hasattr()` function internally calls the
`obj.__getattr__()` or `obj.__getattribute__()` of the target object.
Hence the reaction can be changed on the target object.

This starts to use `safe_getattr()` to check the object is mocked or not
and to prevent an unexpected error.
2021-01-05 23:37:40 +09:00
Takeshi KOMIYA 2d53b7cd66 Update CHANGES for PR #8649 2021-01-04 22:18:28 +09:00
Takeshi KOMIYA 8131e03a52 Merge branch '3.4.x' into 3.x 2021-01-04 21:46:40 +09:00
Takeshi KOMIYA 4755557a7d Bump version 2021-01-04 21:43:54 +09:00
Takeshi KOMIYA 83d5a323ef Bump to 3.4.2 final 2021-01-04 21:42:37 +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 54ef601049 Merge pull request #8630 from tk0miya/8629_warning_for_html_use_opensearch_twice
Fix #8629: html: A type warning for html_use_opensearch is shown twice
2021-01-01 13:14:39 +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 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 1353a7b82f Merge branch '3.4.x' into 8616_AttributeError_for_non_class 2020-12-31 21:12:29 +09:00