Commit Graph

152 Commits

Author SHA1 Message Date
Takeshi KOMIYA
af6ed52ca1
Merge branch '3.x' into 8446_escape_spaces_inside_desc_signatures 2021-02-01 01:24:02 +09:00
Takeshi KOMIYA
c9480f9943 Merge branch '3.x' 2021-01-28 00:56:46 +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
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
4cae0ecf86
Merge pull request #8690 from tk0miya/4550_align_default
Fix #4550: The align attribute of figure nodes becomes None by default
2021-01-18 02:14:27 +09:00
Takeshi KOMIYA
30f8640bab Merge branch '3.x' 2021-01-16 21:51:46 +09:00
Takeshi KOMIYA
3248bef3cc Fix #4550: The align attribute of figure nodes becomes None by default
To keep compatibility with the standard doctree model of docutils,
this stops to use 'default' value as a default value of the align
attribute for figure and table nodes.
2021-01-16 21:19:38 +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
Takeshi KOMIYA
410b8e03f3 refactor: Access config object from self directly in writers 2021-01-10 23:49:12 +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
96fe4c110c Fix #8446: html: consecutive spaces are displayed as single space
In HTML, consecutive spaces are considered as single space by HTML
browsers.  To represent them as is, we have to escape them on rendering
them into HTML.  This starts to escape the whole of desc_signature node.
2020-11-22 23:12:04 +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
Takeshi KOMIYA
8412347f5d Merge branch '3.x' 2020-08-14 14:28:58 +09:00
Yves Chevallier
53a82a5630 Use node as location 2020-08-12 16:29:26 +02:00
Takeshi KOMIYA
70d521ad9c Merge branch '3.x' 2020-07-11 21:59:58 +09:00
Takeshi KOMIYA
6dfbc5108e Close #7849: html: Add html_codeblock_linenos_style 2020-07-11 20:59:38 +09:00
Takeshi KOMIYA
a86346aca6 Remove deprecated features marked as RemovedInSphinx40Warning 2020-04-29 15:12:39 +09:00
Takeshi KOMIYA
4860b451f2 Merge branch '3.x' 2020-04-06 00:23:29 +09:00
Takeshi KOMIYA
49063aa4eb Fix html: a width of table was ignored on HTML builder (ref: #6564) 2020-03-29 17:56:19 +09:00
Takeshi KOMIYA
90fb44ee43 Merge branch '3.x' 2020-03-23 00:07:51 +09:00
Takeshi KOMIYA
2659a37c1f Fix #7357: html: Resizing SVG image fails with ValueError 2020-03-22 23:23: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
3e0618ba3a Deprecate codes for docutils-0.13 or 0.14 2020-03-07 19:36:41 +09:00
Takeshi KOMIYA
2b70875f6a Merge branch 'drop_desc_signature_first' into 3.x 2020-02-22 17:39:56 +09:00
Takeshi KOMIYA
1f06bacc93
Merge pull request #7117 from tk0miya/drop_desc_signature_first
Deprecate desc_signature['first']
2020-02-22 17:37:38 +09:00
Takeshi KOMIYA
6e0119526a Merge branch '2.0' 2020-02-09 16:21:32 +09:00
Takeshi KOMIYA
2dd02729bc Fix #7112: html: SVG image is not layouted as float even if aligned 2020-02-09 15:04:53 +09:00
Takeshi KOMIYA
df3c0448dd Deprecate desc_signature['first'] 2020-02-09 00:58:42 +09:00
Takeshi KOMIYA
af2a3c0dde Merge branch '2.0' 2020-01-08 01:37:53 +09:00
Takeshi KOMIYA
9cc25367b8 Fix #6696: html: scale option of image/figure directive not working for SVG
Note: imagesize-1.2.0 or above is required
2020-01-03 00:20:05 +09: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
5640cf879f Merge branch '2.0' 2019-12-22 18:47:30 +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
712c20a3d9 Merge branch '2.0' 2019-12-16 00:05:35 +09:00
Takeshi KOMIYA
2ae2b0d98a Merge branch '2.0' into 6632 2019-12-14 22:57:59 +09:00
Takeshi KOMIYA
5b53b74bd9 Fix mypy and flake8 violations 2019-12-14 22:56:24 +09:00
Takeshi KOMIYA
15c266c445 Merge branch '2.0' 2019-11-30 21:52:42 +09:00
Takeshi KOMIYA
5466906c7b Migrate to py3 style type annotation: sphinx.writers.html5 2019-11-26 01:36:00 +09:00
Yves Chevallier
06648a3157
Fix annotations 2019-08-08 09:03:29 +02:00
Yves Chevallier
9827851507 Wrap <span> around sectnum in HTML titles 2019-08-01 18:19:24 +02:00
Yves Chevallier
de38f0ad5d Add get_secnumber to simplify add_secnumber 2019-08-01 18:19:17 +02:00
Takeshi KOMIYA
4c19ab7058 Merge commit '54d5fcfaebc3364044761d30c0fed6bd4d3052c3' 2019-06-02 01:02:54 +09:00
Takeshi KOMIYA
e001d358d0 Add :force: option to code directives 2019-06-01 13:42:57 +09:00
Takeshi KOMIYA
ce3c5735cd Merge branch '2.0' 2019-06-01 01:45:47 +09:00
Takeshi KOMIYA
bd4cd571e9 Fix #4390: html: Consistent and semantic CSS for signatures 2019-05-29 00:49:13 +09:00
Takeshi KOMIYA
df05d9254d Merge branch '2.0' 2019-04-07 19:29:52 +09:00
Takeshi KOMIYA
a397610887 Fix #6263: html: HTML5Translator crashed with invalid field node 2019-04-07 18:11:02 +09:00
Takeshi KOMIYA
61098a0ae2 Drop features and APIs deprecated in 1.8 2019-03-30 14:50:37 +09:00
Takeshi KOMIYA
524ac7ff0a Fix #6096: html: Anchor links are not added to figures 2019-02-24 19:29:12 +09:00
Takeshi KOMIYA
7459d8771a Fix HTML: Invalid HTML5 file is generated for glossary (refs: #4611)
Note: It was caused by a glossary having multiple terms for one
description.
2019-01-03 18:17:17 +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
Jon Dufresne
1f6ce4cd44 Replace escape sequence '\u00B6' with literal '¶'
More obvious to the reader.
2018-12-20 18:39:51 -08:00
Takeshi KOMIYA
a3ab764a5b Reorder the arguments for translators 2018-12-17 23:20:01 +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
c6bd84a614 refactor: Remove u-prefix from strings 2018-12-16 21:28:51 +09:00
Jon Dufresne
ade973f4e3 Use Python 3 super() argument-less syntax
The form is less verbose and more idiomatic for Python 3 only code.

https://docs.python.org/3/library/functions.html#super
2018-12-15 08:35:55 -08:00
Takeshi KOMIYA
6bc357140d Replace all "unicode" type by "str" 2018-12-15 23:57:43 +09:00
Takeshi KOMIYA
9dfc5e7efe Add docutils-stubs to test deps 2018-12-15 02:42:43 +09:00
Takeshi KOMIYA
f1bf847726 Use nodes.Element for visitor/departure methods
To follow docutils-stubs rule, we use nodes.Element for
visitor/departure methods.
2018-12-15 01:39:50 +09:00
Takeshi KOMIYA
05036b9578 Remove SphinxTranslator.get_settings()
It was introduced to fake its type information and make mypy silent.
But the warnings had came from wrong typing of docutils-stubs.
(see https://github.com/tk0miya/docutils-stubs/pull/28)

After the fix, the helper method is not needed for us. So this
removes it right away.
2018-12-12 17:32:04 +09:00
Takeshi KOMIYA
4eb1a999a7 Remove HTML5Translator.should_be_compact_paragraph() (unused)
It was only copied from HTML4 translator, never used.
2018-12-12 12:29:31 +09:00
Takeshi KOMIYA
3863256cb6 Add SphinxTranslator as an abstract class 2018-12-03 22:30:56 +09:00
Takeshi KOMIYA
fd73a169c7 Fix annotations (minor fixes) 2018-12-03 01:11:06 +09:00
Takeshi KOMIYA
488d3263f3 Fix annotations for writers 2018-11-30 00:18:47 +09:00
Takeshi KOMIYA
31c4d06a22 refactor: Use super() to call methods of superclass 2018-11-28 01:58:32 +09:00
Takeshi KOMIYA
670c8a6173 Fix annotations for writers 2018-11-28 00:54:53 +09:00
Takeshi KOMIYA
3c99d00605 Add sphinx.util.typing:unicode to help mypy-3 migration 2018-11-24 23:19:51 +09:00
Jon Dufresne
b8631079bf Replace six.string_types with native str 2018-11-21 06:47:15 -08:00
Takeshi KOMIYA
a608f7e725 Update type hints to HTML5 writer 2018-11-21 01:10:25 +09:00
Jon Dufresne
710ca3d7c3 Use super() to call parent class's method 2018-11-11 13:07:12 -08:00
Takeshi KOMIYA
257394a459 Fix #5471: Show appropriate warning for deprecated APIs 2018-10-17 02:05:07 +09:00
Takeshi KOMIYA
aee5fd04d4 Fix #5348: download reference to remote file is not displayed 2018-08-26 22:25:35 +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
4f296c5e67 Refactor: Run highlightlang on resolving phase 2018-07-21 13:54:09 +09:00
Takeshi KOMIYA
af4647c492 Merge branch '1.7' 2018-04-14 15:43:38 +09:00
Takeshi KOMIYA
4546c8a1b1 Fix #4817: wrong URLs on warning messages 2018-04-08 22:32:49 +09:00
Takeshi KOMIYA
2d0e2557b8
Merge branch 'master' into refactor_enumerable_nodes 2018-03-21 14:40:58 +09:00
Takeshi KOMIYA
9efaf18852 Merge branch '1.7' 2018-03-18 01:21:01 +09:00
Takeshi KOMIYA
62fa80399d Add Domain#get_enumerable_node_type() 2018-03-17 10:00:54 +09:00
Takeshi KOMIYA
70a622b86c Revert "Use typing.TYPE_CHECKING for typehints"
This reverts commit a073e17537.
2018-03-13 23:23:15 +09:00
Takeshi KOMIYA
6faef28150 Make console and warning messages translatable 2018-03-03 23:18:38 +09:00
Takeshi KOMIYA
a073e17537 Use typing.TYPE_CHECKING for typehints 2018-02-14 22:57:38 +09:00
Takeshi KOMIYA
9f5c676322 Use flake8-import-order 2018-01-28 01:52:16 +09:00
Takeshi KOMIYA
4d040abafb Fix #4079: Add notranslate class to let Google Translate know they are not translatable 2018-01-13 20:25:49 +09:00
Antoine Beaupré
90f7c7ef3f
add link to manpages in HTML builder
It is useful to have the HTML documentation builder actually link to
real rendered versions of HTML manpages in its output. That way people
can click on manpages to get the full documentation. There are a few
services offering this online, so we do not explicitly enable one by
default, but the Debian manpages repository has a lot of the manpages
pre-rendered, so it is used as an example in the documentation.

The parsing work is done by a transformer class that parses manpage
objects and extract name/section elements. Those then can be used by
writers to cross-reference to actual sites. An implementation is done
in the two HTML writers, but could also apply to ePUB/PDF writers as
well in the future.

This is not enabled by default: the `manpages_url` configuration item
needs to be enabled to point to the chosen site. The `page`, `section`
and `path` parameters are expanded through Python string formatting in
the URL on output.

Unit tests are fairly limited, but should cover most common use-cases.
2018-01-11 13:20:34 -05:00
Takeshi KOMIYA
f1f6ca8cc9 Merge branch 'happy_new_year' into master 2018-01-01 01:09:17 +09:00
Takeshi KOMIYA
2426cedb8b A happy new year! 2018-01-01 01:06:58 +09:00
David Lechner
831f89a687 Closes #3160: Use <kbd> tag for :kbd: role in html writers 2017-10-30 10:23:55 -05:00
Dmitry Shachnev
a9cbb42e7f Remove bulk_text_processors methods, they are no longer needed 2017-04-25 14:17:31 +03:00
Dmitry Shachnev
edc7f30b9c Remove the custom smartypants code
Instead rely on docutils’ ‘smart_quotes’ option which is available
since docutils 0.10.

This adds support for internationalization: our code supported only
English quotes, while docutils code supports 27 different languages.

Closes #498, #580, #3345, #3472.
2017-04-25 14:17:13 +03:00
Travis A. Everett
4c67c110f6 Also change depart_admonition calls for html5 builder 2017-03-04 20:32:46 -06:00