Commit Graph

17077 Commits

Author SHA1 Message Date
Takeshi KOMIYA
37b07ca7a0
Merge pull request #8754 from tk0miya/7118_quickstart_mojibake
Fix #7118: quickstart: got Mojibake if libreadline unavailable
2021-01-25 22:51:14 +09:00
Takeshi KOMIYA
77fad1ec98
Merge pull request #8760 from jfbu/pdftex_8253
LaTeX: sync pdftex engine default imageresolution with pxunit
2021-01-25 22:50:21 +09: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
9a156baa87 Fix #7118: quickstart: got Mojibake if libreadline unavailable
Do not output escape sequence for libreadline (\1 and \2) when
libreadline is unavailable.
2021-01-25 20:36:53 +09: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
934dd62952
Merge pull request #8749 from tk0miya/8737_invalid_logo_is_shown
Fix #8737: html: broken img tag is appeared when html_logo not set
2021-01-25 20:35:08 +09:00
Takeshi KOMIYA
eaa14bb0b0
Merge pull request #8748 from tk0miya/6550_deprecation_warning_for_html_add_permalinks
Fix #6550: Emit a deprecation warning for html_add_permalinks
2021-01-25 20:34:09 +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
jfbu
a786f73d7f LaTeX: sync pdftex engine default imageresolution with pxunit
Closes: #8253

The 'pxunit' key from latex_elements instructs how to handle image
dimensions specified in px units.

But pdftex has \pdfimageresolution which is used when an image file does
not provide readable or legit values for the x and/or y resolution.

This commit syncs them: from 'pxunit' the default image resolution in
pixels per inch (an integer) is computed.

This way an image will behave the same if:

- it is loaded with no explicit size set, _and_ no readable image
  resolution data is readable from the file (or that data matches the
  'pxunit' setting)

- or a size is set in figure directive using px units and equal to the
  natural pixel size of the image,

This also with 'lualatex' but is ignored by with 'xelatex' and
'uplatex'.
2021-01-25 08:20:45 +01:00
Takeshi KOMIYA
8dc8c01425 Fix #8756: viewcode: highlighted code is generated even if not referenced
viewcode does not purge unreferenced modules on incremental build.  This
adds env-purge-doc handler to clean them.
2021-01-25 01:50:21 +09:00
Takeshi KOMIYA
81ba9273ca Fix #8745: i18n: KeyError if a new auto footnote_ref in translations
Some writers will be crashed by KeyError because of lack of the refid if
a new auto footnote reference is added to the message catalog by
translation misses.

This detects the invalid footnote references and removes them on
the translation phase.
2021-01-25 00:30:50 +09:00
Takeshi KOMIYA
ec375087b8
Merge pull request #8740 from tk0miya/7642_optimize_case_insensitive_match_of_term
Close #7642: std domain: Optimize case-insensitive match of term
2021-01-24 23:46:59 +09:00
Takeshi KOMIYA
949ec8737f Close #1638: html: Add permalink icons to glossary terms 2021-01-24 23:35:37 +09:00
Takeshi KOMIYA
b5ff272f77 Close #7642: std domain: Optimize case-insensitive match of term
Since 3.0.1, the term role has matched to the words in glossary
case-sensitively.  It's important change for preventing conflicts by
word cases.  But, it also brings a problem for references in natural
text.

This optimizes the case-insensitive match of the term role.  It allows
to search glossary words twice with no performance penalty; the first
search is case sensitive and another is case insenstive.
2021-01-24 23:32:53 +09:00
Takeshi KOMIYA
a3e83a80f0
Merge pull request #8746 from jfbu/latex_improve_our_pdfdocs
Improve Sphinx own pdf docs
2021-01-24 23:31:42 +09:00
Takeshi KOMIYA
a5c716b635
Merge pull request #8753 from francoisfreitag/rm-n
Linkcheck: Derive number of links from the post-transform result
2021-01-24 22:55:33 +09:00
Takeshi KOMIYA
6c01d7614b
Merge branch '3.x' into rm-n 2021-01-24 22:43:33 +09:00
Takeshi KOMIYA
2e0d7e539a
Merge pull request #8751 from francoisfreitag/mult-open
Linkcheck: Don’t repeatedly open/close log files
2021-01-24 21:22:47 +09:00
François Freitag
1121e5e8bc
Linkcheck: Derive number of links from the post-transform result
The number of links to check is the number of links in self.hyperlinks,
populated by the post-transform.
2021-01-24 12:24:52 +01:00
François Freitag
54df51e86f
Linkcheck: Don’t repeatedly open/close log files
Opening and closing a file requires processing from the operating
system. Repeatedly opening and closing wastes system resources and
hinders buffering, causing a flush (disk I/O) after each write
operation.

Using a context manager ensures the logs are flushed to disk and files
are properly closed whether the program exists successfully or an
exception occurs. Compared to the previous implementation, a brutal
shutdown of the machine (e.g. power cord disconnected) could cause some
log lines not to be written. That should not be an issue in practice.

Now, files are created and truncated when linkcheck submitted the links
to check to the threads and is ready to process the results, instead of
when the builder is constructed. It keeps the file operations closer to
their use.
2021-01-24 12:15:07 +01:00
Takeshi KOMIYA
34417831c5 doc: Add hyperlinks to classifiers for sphinx extensions and themes 2021-01-24 16:45:50 +09:00
Takeshi KOMIYA
0ad32905bf Merge branch '3.x' 2021-01-24 16:39:43 +09:00
Takeshi KOMIYA
51d500833e Merge branch '3.x' into 7774_remove_develop.rst 2021-01-24 16:34:47 +09:00
Takeshi KOMIYA
03629b1832 Fix #8737: html: broken img tag is appeared when html_logo not set 2021-01-24 15:36:52 +09:00
Takeshi KOMIYA
41ee2d6e65
Merge pull request #8738 from tk0miya/8118_today_fmt
Fix #8118: doc: the default setting of today_fmt
2021-01-24 14:42:20 +09:00
Takeshi KOMIYA
0e6a2a9ebd
Merge pull request #8737 from tk0miya/8510_html_logo_url
Allow user to use url to reference html logo & favicon
2021-01-24 14:40:56 +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
90ced6c4b7 Fix #6550: Emit a deprecation warning for html_add_permalinks
Let's start to emit a deprecation warning for html_add_permalinks since
the major release v4.0.
2021-01-24 14:38:03 +09:00
Takeshi KOMIYA
502c4ee5fb Merge branch '3.x' 2021-01-24 14:32:13 +09:00
Takeshi KOMIYA
becf8f43be
Merge pull request #8599 from tk0miya/6550_html_permalinks_icon
Close #6550: html: Allow to use HTML permalink texts
2021-01-24 14:30:06 +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
59036b1e65
Update sphinx/application.py 2021-01-24 14:16:26 +09:00
Takeshi KOMIYA
3a0a6556c5
Merge pull request #8741 from tk0miya/refactor_doc3
doc: Show type annotations for methods of Sphinx application class
2021-01-24 14:11:37 +09:00
Takeshi KOMIYA
93c3edca2f
Merge pull request #8743 from tk0miya/8054_types_for_add_config_value
Fix #8054: Add explanation for types argument of add_config_value()
2021-01-24 14:09:26 +09:00
Takeshi KOMIYA
790adf1f4a
Merge pull request #8739 from tk0miya/refactor_doc2
doc: minor fix
2021-01-24 14:08:39 +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
ee5560b773
Merge pull request #8732 from tk0miya/refactor_documentation_options
refactor: html theme: Insert documentation_options.js via script_files
2021-01-24 14:00:13 +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
3a3a479f1e Improve Sphinx own pdf docs
Prior to this the depth of the bookmarks is too low, one does not even
get to see for example what are the built-in extensions offered by
Sphinx.

Similarly the LaTeX created table of contents has not enough depth.
Dozens of contiguous pages from our documentation get only a single
link, it is very hard for newcomer to get some feeling of the scope of
Sphinx.  With a more detailed table of contents (be it inside the PDF or
via the collapsable bookmark panel of PDF viewer) learning Sphinx is
easier.
2021-01-24 00:41:59 +01: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
2626a74f0a doc: Show type annotations for methods of Sphinx application class 2021-01-24 00:08:04 +09:00
Takeshi KOMIYA
3100ceb220 doc: minor fix 2021-01-23 22:32:17 +09:00
Takeshi KOMIYA
f707cb30a1
Merge pull request #7798 from stefanodavid/code-block-crossref-doc
documentation for proper code-block cross-referencing
2021-01-23 22:31:02 +09:00
Takeshi KOMIYA
41924776c4 Fix #8118: doc: the default setting of today_fmt
Sphinx has used `'%b %d, %Y'` as a default setting of today_fmt longer.
So this fixes our document as Sphinx does.
2021-01-23 22:11:33 +09:00
Takeshi KOMIYA
2843fdfdea
Merge pull request #8736 from jfbu/latex_fix_8735
Fix #8735
2021-01-23 21:01:44 +09:00