Commit Graph

703 Commits

Author SHA1 Message Date
Martin Hasoň
7327e56dff
Depart method for node is optional 2021-04-09 12:44:10 +02:00
Takeshi KOMIYA
3ad1e5e7d1
Merge pull request #9064 from tk0miya/refactor_type_annotation
refactor: Add Optional to type annotations
2021-04-08 21:42:21 +09:00
Takeshi KOMIYA
d3f0de4e12 refactor: Add Optional to type annotations 2021-04-08 01:56:50 +09:00
Takeshi KOMIYA
eb68c237dd refactor: Use PEP-526 based variable annotation 2021-04-08 01:54:17 +09:00
Takeshi KOMIYA
1b0d4672a4 refactor: use raw Type for type annotations 2021-04-04 14:47:43 +09:00
igo95862
c57cb0b5ed doc: Link autodoc tutorial in add_autodocumenter docstring
Uses :ref: link because :doc: does not work.
2021-03-09 17:57:30 +03:00
Takeshi KOMIYA
d25c3ad241 Update type annotations 2021-02-09 22:49:01 +09:00
Takeshi KOMIYA
c9480f9943 Merge branch '3.x' 2021-01-28 00:56:46 +09:00
Takeshi KOMIYA
84ef92226f doc: Apply :params: to some APIs in app class 2021-01-26 01:19:47 +09:00
Takeshi KOMIYA
0ad32905bf Merge branch '3.x' 2021-01-24 16:39:43 +09:00
Takeshi KOMIYA
851716cd1a
Merge pull request #8744 from tk0miya/refactor_doc4
doc: Apply :params: to some APIs in app class
2021-01-24 14:39:21 +09:00
Takeshi KOMIYA
502c4ee5fb Merge branch '3.x' 2021-01-24 14:32:13 +09:00
Takeshi KOMIYA
59036b1e65
Update sphinx/application.py 2021-01-24 14:16:26 +09:00
Takeshi KOMIYA
a2d6ee6108 doc: Apply :params: to some APIs in app class 2021-01-24 01:11:04 +09:00
Takeshi KOMIYA
f873a5890f Fix #8054: Add explanation for types argument of add_config_value() 2021-01-24 00:44:20 +09: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
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
7739b7d7dd doc: Add explanation about stable sort of html_*_files 2021-01-03 00:17:19 +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
4b452338f9 Merge branch '3.x' 2021-01-01 13:57:19 +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
3a4ae2092a Merge branch '3.x' 2020-11-21 01:01:36 +09:00
Takeshi KOMIYA
ce53ccefba Fix #8398: Fix type annotation for "confdir" of Sphinx.__init__()
None is allowed to the argument. So it should be "Optional[str]" instead
of "str".
2020-11-13 02:22:15 +09:00
Takeshi KOMIYA
a3af1e860b Merge branch '3.3.x' into 3.x 2020-11-12 23:40:41 +09:00
Takeshi KOMIYA
279e547860 Merge branch '3.x' 2020-11-12 02:50:43 +09:00
François Freitag
0949735210
Sort imports with isort
Keep imports alphabetically sorted and their order homogeneous across
Python source files.

The isort project has more feature and is more active than the
flake8-import-order plugin.

Most issues caught were simply import ordering from the same module.
Where imports were purposefully placed out of order, tag with
isort:skip.
2020-11-11 13:19:05 +01:00
Dmitry Shachnev
f92989ca6f Put system locale path after the paths specified by configuration
In Debian, we ship the translation data for Sphinx in the default search
path, /usr/share/locale/. When a .mo file is present there, it takes
priority over the translation files specified by the configuration, so
overriding does not work. This makes test_customize_system_message fail.
2020-11-09 21:37:01 +03:00
Takeshi KOMIYA
445b9515c1 Merge branch '3.x' 2020-10-24 18:12:45 +09:00
Takeshi KOMIYA
c82d1c76e1
Merge pull request #8281 from tk0miya/8073_update_directive_example
docs: Fix an example for add_directive()
2020-10-06 00:49:17 +09:00
Takeshi KOMIYA
ca87e47b7d
Merge pull request #8280 from tk0miya/refactor_add_source_parser
refactor: Change signature of app.add_source_parser()
2020-10-06 00:48:37 +09:00
Takeshi KOMIYA
598b85da75 Merge branch '3.x' into master 2020-10-04 22:41:44 +09:00
Takeshi KOMIYA
7b395f6b25 docs: Fix an example for add_directive() 2020-10-04 14:22:02 +09:00
Takeshi KOMIYA
129e09c6e3 refactor: Change signature of app.add_source_parser()
To make compatible with old versions, app.add_source_parser() have taken
two types of arguments.  But the compatibility was no longer needed
since 3.0.  So it would be better to use clearer signature.
2020-10-04 14:15:43 +09:00
Takeshi KOMIYA
7f7a207626 docs: Add documentation for "override" flag of app API 2020-10-04 14:13:03 +09:00
Takeshi KOMIYA
37235c71e0 Fix #6640: i18n: Failed to override system message translation
Our document describes that users can override system messages via
their own message catalog named `sphinx.mo` under the locale_dirs.
But it has not been used since its beginning of i18n mechanism because
the priority of users' message catalog is lower than system's.

This makes the priority of users' message catalog higher than system's.
2020-10-04 13:31:37 +09:00
Dominic Davis-Foster
05ad7e8020 Fix typo in warning emitted from Sphinx.add_lexer() 2020-08-25 13:48:17 +01:00
Takeshi KOMIYA
44f4b2ad97 Merge tag 'v3.1.0' 2020-07-05 00:10:47 +09:00
Brandon Houghton
cb9dd0a0b4
Fix reported dir when throwing ApplicationError
if path.exists(self.outdir) and not path.isdir(self.outdir), error reported self.srcdir which should be self.outdir
2020-06-03 15:33:58 -04:00
Takeshi KOMIYA
068b9b5738 Merge branch '3.x' 2020-06-04 00:18:30 +09:00
Takeshi KOMIYA
d501b94311 latex: Allow to add LaTeX package after hyperref loaded via API 2020-05-24 01:51:46 +09:00
Takeshi KOMIYA
3206e3154a Add allowed_exceptions parameter to Sphinx.emit() (refs: #7683)
It allows handlers to raise specified exceptions.
2020-05-17 19:18:10 +09:00
Takeshi KOMIYA
3c7d35d2a2 Merge branch '3.x' 2020-05-17 19:12:56 +09:00
Álvaro Mondéjar
62b44e6456 Fix double space inconsistences in code, CHANGES and translations. 2020-05-09 14:44:39 +02:00
Takeshi KOMIYA
41b4a77dea Add stacklevel parameter to warnings.warn() call 2020-05-03 23:34:35 +09:00
Takeshi KOMIYA
a86346aca6 Remove deprecated features marked as RemovedInSphinx40Warning 2020-04-29 15:12:39 +09:00
Takeshi KOMIYA
c7e590818a Merge branch '3.x' 2020-03-21 17:53:22 +09:00
Takeshi KOMIYA
86c32fe0f1 Fix #7345: sphinx-build: Sphinx crashes if output directory exists as a file 2020-03-21 14:47:02 +09:00
Takeshi KOMIYA
6682f89871 Fix #7282: i18n: messages using ngettext() does not translated 2020-03-14 19:52:26 +09:00
Takeshi KOMIYA
9086ecdfff Merge branch '3.x' 2020-03-12 01:37:23 +09:00
Takeshi KOMIYA
f85b870ad5 Merge branch '2.x' into 3.x 2020-03-12 01:37:08 +09:00
Takeshi KOMIYA
99476f37e7 Fix mypy violations (with mypy-0.770) 2020-03-12 01:25:18 +09:00
Takeshi KOMIYA
941bf951ac Hello TYPE_CHECKING! 2020-03-07 19:36:41 +09:00
Takeshi KOMIYA
6d4fefebf4 Deprecate codes for python 3.5 2020-03-07 19:36:41 +09:00
Takeshi KOMIYA
2e338aa5cd Support priority of event handlers 2020-01-16 17:04:48 +09:00
Takeshi KOMIYA
cad1f86dd8 Merge branch '2.0' 2020-01-11 02:56:58 +09:00
Takeshi KOMIYA
a6a1721de6 refactor: Rename var keyword argument to "**kwargs" 2020-01-08 01:39:07 +09:00
Chris Holdgraf
6117e7619a
Update application.py 2020-01-04 06:12:16 -08:00
Chris Holdgraf
01ffa6cf04
updating docstring for add_js_file for body element 2020-01-03 14:54:26 -08:00
Takeshi KOMIYA
e628afd5cd Merge branch '2.0' 2020-01-01 11:39:46 +09:00
Takeshi KOMIYA
fc523c3ccf A happy new year! 2020-01-01 11:15:42 +09:00
Takeshi KOMIYA
ab184ac20d mypy: Enable disallow_incomplete_defs flag for type checking 2019-12-30 17:22:56 +09:00
Takeshi KOMIYA
3bf39be471 Fix flake8 violations 2019-12-25 11:46:50 +09:00
Takeshi KOMIYA
d717f5ae31 Merge branch '2.0' 2019-12-25 11:41:54 +09:00
Takeshi KOMIYA
337780c89f Migrate to py3 style type annotation: sphinx.application 2019-12-25 02:04:08 +09:00
Takeshi KOMIYA
5640cf879f Merge branch '2.0' 2019-12-22 18:47:30 +09:00
Takeshi KOMIYA
6d6fe9da0d Add IndexDomain 2019-12-22 17:20:35 +09:00
Antony Lee
814513ba9f Replace a and b or c by the more legible b if a or c. 2019-12-21 11:50:18 +01:00
Takeshi KOMIYA
7ec567b6d0 Merge branch '2.0' 2019-12-09 00:13:42 +09: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
Takeshi KOMIYA
6644830941 Merge branch '2.0' 2019-11-17 14:24:04 +09:00
Thomas Robitaille
fa1cca1fee Improve variable names and code style 2019-11-12 14:29:20 +00:00
Thomas Robitaille
0a437bc9d6 Give a warning when extensions are explicitly not parallel safe 2019-11-12 14:22:21 +00:00
jfbu
685e3fdb49 Merge branch '2.0' 2019-08-01 17:49:24 +02:00
Takeshi KOMIYA
0c48a28ad7 Fix type annotation for python 3.5.1 2019-07-13 23:46:17 +09:00
Takeshi KOMIYA
75477633b6 Merge branch '2.0' 2019-07-01 00:29:51 +09:00
Takeshi KOMIYA
0ff514743f Close #6475: Add override argument to app.add_autodocumenter() 2019-06-30 01:41:15 +09:00
Takeshi KOMIYA
4c19ab7058 Merge commit '54d5fcfaebc3364044761d30c0fed6bd4d3052c3' 2019-06-02 01:02:54 +09:00
Takeshi KOMIYA
71842264b2 Sphinx.add_lexer() now takes a Lexer class instead of instance 2019-06-01 13:49:16 +09:00
Takeshi KOMIYA
5d8c25b605 refactor: app.add_lexer() 2019-06-01 13:42:57 +09:00
Takeshi KOMIYA
b9d7239d90 Merge branch '2.0' 2019-05-29 00:51:25 +09:00
Eric Larson
926e0e766d ENH: Explain warnings-as-errors 2019-05-14 14:32:11 -04:00
Takeshi KOMIYA
06f86b0639 Make EventManager portable
So far, we need to bypass application object for modules to emit
a event.  This make EventManager portable and easy to pass event
emitter.  This brings modules less coupled with application object.
2019-04-16 14:06:36 +09:00
Takeshi KOMIYA
15bc5a32bb
Merge pull request #6260 from tk0miya/refactor_events
Make EventManager portable
2019-04-16 14:04:54 +09:00
Takeshi KOMIYA
df05d9254d Merge branch '2.0' 2019-04-07 19:29:52 +09:00
Takeshi KOMIYA
9e2aba54d3 Make EventManager portable
So far, we need to bypass application object for modules to emit
a event.  This make EventManager portable and easy to pass event
emitter.  This brings modules less coupled with application object.
2019-04-06 15:36:50 +09:00
Takeshi KOMIYA
c840cb744c Merge branch '2.0' into refactor_citations 2019-04-06 14:23:04 +09:00
Takeshi KOMIYA
267e7e5c16 Merge branch '2.0.1' into 2.0 2019-03-31 20:50:07 +09:00
Takeshi KOMIYA
87c6335b46 Move transforms for citations to sphinx.domains.citation 2019-03-30 20:31:10 +09:00
Takeshi KOMIYA
61098a0ae2 Drop features and APIs deprecated in 1.8 2019-03-30 14:50:37 +09:00
Takeshi KOMIYA
bd903c8904 Show deprecation warning for sphinx.application.CONFIG_FILENAME 2019-03-30 14:48:05 +09:00
Takeshi KOMIYA
86f0336693 Merge branch '2.0' 2019-03-21 02:21:59 +09:00
Takeshi KOMIYA
23f7b3a6e7 refactor: Remove lists of transforms from SphinxStandalonReader 2019-03-17 13:55:02 +09:00
Takeshi KOMIYA
16b1b71a3a docs: drop mention to deprecated method (refs: #6174) 2019-03-14 00:38:54 +09:00
Takeshi KOMIYA
fb8838ee53 refactor: Use CatalogRepository instead of find_catalog_source_file() 2019-02-27 22:47:08 +09:00
Takeshi KOMIYA
1ca210aab1 Separate json and pickle to sphinxcontrib package 2019-02-17 22:31:50 +09:00
Takeshi KOMIYA
3b49f9fe3d Separate htmlhelp to sphinxcontrib package 2019-02-15 01:44:32 +09:00
Takeshi KOMIYA
644d555837 Don't import pycompat in sphinx.application (not used) 2019-02-11 16:41:19 +09:00
Takeshi KOMIYA
dd371a59de Move DirectoryHTMLBuilder to sphinx.builders.dirhtml package 2019-02-07 02:06:39 +09:00
Takeshi KOMIYA
c4397318d3 Separate applehelp to sphinxcontrib package 2019-02-06 00:44:37 +09:00
Takeshi KOMIYA
2bd69350a7 Separate devhelp to sphinxcontrib package 2019-01-20 03:03:50 +09:00
Takeshi KOMIYA
6be9d2a08e Separate qthelp to sphinxcontrib package 2019-01-19 16:34:06 +09:00
Takeshi KOMIYA
9c52b4ed6c Drop dependency: sphinxcontrib-websupport 2019-01-14 19:44:12 +09:00
Takeshi KOMIYA
647021be64 Add progress_message() as a helper for progress messages 2019-01-12 22:06:04 +09:00
Takeshi KOMIYA
b08a7c4757 Move SingleFileHTMLBuilder to sphinx.builders.singlehtml package 2019-01-11 01:59:56 +09:00
Takeshi KOMIYA
76e9f57c2e Merge branch '1.8' 2019-01-02 16:16:25 +09:00
Takeshi KOMIYA
1b1ebd2c75 A happy new year! 2019-01-02 16:00:30 +09:00
jfbu
32d57b8637 Merge branch '1.8'
resolved Conflicts:
	doc/development/tutorials/todo.rst
	sphinx/locale/__init__.py
	sphinx/search/zh.py
2018-12-28 12:50:20 +01:00
jfbu
1e07cb10fc Fix various spelling typos 2018-12-27 13:06:33 +01:00
Takeshi KOMIYA
de49b991f6 refactor: Use simple Input class 2018-12-17 22:07:56 +09:00
Jon Dufresne
bade33c7e4 Remove unnecessary encoding cookie from Python source files
In Python 3, the default encoding of source files is utf-8. The encoding
cookie is now unnecessary and redundant so remove it. For more details,
see the docs:

https://docs.python.org/3/howto/unicode.html#the-string-type

> The default encoding for Python source code is UTF-8, so you can
> simply include a Unicode character in a string literal ...

Includes a fix for the flake8 header checks to stop expecting an
encoding cookie.
2018-12-16 12:22:12 -08:00
Takeshi KOMIYA
6bc357140d Replace all "unicode" type by "str" 2018-12-15 23:57:43 +09:00
Takeshi KOMIYA
b56f4f9022 Remove print_function feature 2018-12-15 23:16:10 +09:00
Takeshi KOMIYA
53917f228f Move to py3 mode for mypy (and remove many "type: ignore" comments) 2018-12-15 02:42:42 +09:00
Takeshi KOMIYA
773568a4e2 refactor: Use app.add_node() to register Sphinx own nodes 2018-12-05 00:05:51 +09:00
Takeshi KOMIYA
382d836771 Fix annotations of enumerable_nodes 2018-12-03 22:07:29 +09:00
Takeshi KOMIYA
bfd35c6ce1 Add role manipulator directives to sphinx.util.docutils 2018-12-01 19:50:12 +09:00
Takeshi KOMIYA
e294b8e036 Add role manipulator functions to sphinx.util.docutils 2018-12-01 18:46:22 +09:00
Takeshi KOMIYA
fcc53447a3 Fix annotations (in some modules) 2018-12-01 12:29:49 +09:00
Takeshi KOMIYA
3c99d00605 Add sphinx.util.typing:unicode to help mypy-3 migration 2018-11-24 23:19:51 +09:00
Takeshi KOMIYA
d4e22793ca Fix annotations for app.add_nodes() and related functions 2018-11-24 21:59:11 +09:00
Jon Dufresne
27a6787d63 Remove use of six.binary_type
Remove type checks for cases that don't apply to Python 3.

For remaining uses, use bytes instead
2018-11-11 19:09:47 -08:00
Takeshi KOMIYA
8f9a76f476 Remove use six.move module 2018-11-12 01:02:14 +09:00
Takeshi KOMIYA
d340ff9abb Fix typehints: sphinx.registry 2018-11-05 11:11:16 +09:00
Takeshi KOMIYA
8b687ac304 Merge branch '1.8' 2018-11-01 01:24:12 +09:00
Takeshi KOMIYA
ca8bc8ca49 refactor: Deprecate app._setting_up_extension 2018-10-17 11:56:11 +09:00
Takeshi KOMIYA
257394a459 Fix #5471: Show appropriate warning for deprecated APIs 2018-10-17 02:05:07 +09:00
Takeshi KOMIYA
eaec3bd916 Add sphinx.project; a manipulator for project and documents 2018-10-16 10:34:58 +09:00
Jon Dufresne
ce8227c6cf Replace all six.itervalues()/.iteritems() with .values()/.items() 2018-09-23 18:26:31 -07:00
Jon Dufresne
02d06bdaf0 Remove uses of six.moves that did not cause any type errors
Removal of the remaining imports may require passing "--python-version
3.5" to the mypy command.
2018-09-23 09:22:06 -07:00
Jon Dufresne
490e4aed41 Remove unnecessary object from class definitions
In Python 3, all classes are new-style classes. The object in the
definition is redundant and unnecessary.
2018-09-11 07:07:01 -07:00
Takeshi KOMIYA
02b763bc71 refactor: Check primary_domain on config-inited event 2018-09-08 22:47:45 +09:00
Takeshi KOMIYA
a7cab001d9 Drop APIs deprecated in 2.0 2018-09-03 00:31:33 +09:00
Takeshi KOMIYA
698d4ed42c Allow to install JS and CSS files on builder-inited event 2018-08-26 11:59:47 +09:00
Takeshi KOMIYA
25bfa1692a refactor: Move repository of changesets to domain from env 2018-08-02 01:51:50 +09:00
Takeshi KOMIYA
609ec5ef33
Merge branch 'master' into 4614_keep_going 2018-07-31 01:11:08 +09:00
Takeshi KOMIYA
104bd42f51
Merge branch 'master' into refactor_highlighter 2018-07-29 11:21:36 +09:00
Takeshi KOMIYA
dd65d00f29 Implement math_renderer framework 2018-07-28 18:20:11 +09:00
Takeshi KOMIYA
e3483e9b04 Closes #4614: sphinx-build: Add :option:--keep-going option to show all warnings 2018-07-23 00:38:47 +09:00
Takeshi KOMIYA
4f296c5e67 Refactor: Run highlightlang on resolving phase 2018-07-21 13:54:09 +09:00
Takeshi KOMIYA
1a477397b2
Merge pull request #5120 from blueyed/fix-doc
doc: fix list with add_object_type
2018-06-26 00:40:22 +09:00
Daniel Hahler
8f94429a21 doc: fix func/meth references to Sphinx 2018-06-25 08:25:56 +02:00
Daniel Hahler
c2b85b923f doc: fix list with add_object_type
This seems to have been accidentally broken in eaaab75ec.
2018-06-25 06:38:32 +02:00
Takeshi KOMIYA
9fc2657d7e Add :confval:html_js_files 2018-06-09 02:38:36 +09:00
Takeshi KOMIYA
106f4ea023 doc: Fix widths of table 2018-06-05 22:45:31 +09:00
Takeshi KOMIYA
f3168d9894 Rename app.add_javascript() to add_js_file() 2018-05-24 23:59:49 +09:00
Takeshi KOMIYA
8fd34b88d3 add_javascript() allows keyword arguments as attributes for <script> tag 2018-05-24 23:59:49 +09:00
Takeshi KOMIYA
3ffde92c54 Add BuildEnvironment.setup() to re-initialize (after unpickle) 2018-05-21 10:36:22 +09:00