Commit Graph

152 Commits

Author SHA1 Message Date
Adam Turner
14a9289d78 Use PEP 604 types 2023-01-01 20:48:39 +00:00
Adam Turner
26f79b0d2d Use PEP 595 types 2023-01-01 20:48:38 +00:00
Adam Turner
f4c8a0a68e Insert `from __future__ import annotations` 2023-01-01 20:48:37 +00:00
Daniel Eades
1abb24e309 remove blanket 'noqas' 2022-12-16 16:50:24 +01:00
Adam Turner
cd3f2e4350 Update typing ignores for mypy 0.990 2022-11-13 20:36:24 +00:00
Adam Turner
592b46c431
Revert `html_codeblock_linenos_style` removal (#10922) 2022-10-16 16:50:53 +01:00
Adam Turner
e70a0fac6d Merge branch '5.x'
# Conflicts:
#	.github/workflows/main.yml
#	CHANGES
#	sphinx/__init__.py
#	sphinx/domains/c.py
2022-10-16 11:24:18 +01:00
Eric Wieser
fa6d42597f
URI-escape image filenames (#10268)
Without this change, local images with `#` in their name result in incorrect URLs

There is already a similar call to `urllib.parse.quote` for file downloads, suggesting this is a sensible approach.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Takeshi KOMIYA <i.tkomiya@gmail.com>
2022-10-13 17:37:07 +01:00
Adam Turner
56aa3412ef Merge branch '5.x'
# Conflicts:
#	setup.py
#	sphinx/__init__.py
2022-09-23 17:27:00 +01:00
danieleades
9b65adc50c
Shrink strict optional whitelist (HTML writers) (#10838) 2022-09-20 22:26:39 +01:00
danieleades
a504ac6100
Improve static typing strictness (#10569) 2022-07-18 22:08:16 +01:00
Adam Turner
ce31e1c0c7
Remove deprecated items for Sphinx 6.0 (#10471) 2022-06-16 21:05:37 +01:00
Takeshi KOMIYA
425a3e6c09 Merge branch '4.x' into 5.x 2022-05-06 03:32:43 +09:00
Takeshi KOMIYA
3805e0646f
Merge pull request #10251 from jbms/fix-inline-syntax-highlight
Make code role highlighting consistent with code-block directive
2022-05-06 02:54:42 +09:00
Jeremy Maitin-Shepard
099b54cb87 Make code role highlighting consistent with code-block directive
Fixes https://github.com/sphinx-doc/sphinx/issues/5157

This is factored out of the sphinx-immaterial theme:
1ef121a612/sphinx_immaterial/inlinesyntaxhighlight.py (L1)

See also:
https://github.com/sphinx-doc/sphinx/pull/6916
2022-03-19 20:37:49 -07:00
Takeshi KOMIYA
aa1bc83c2a Merge branch '4.x' 2022-03-19 22:58:15 +09:00
Adam Turner
5775912455 Collapse single line docstrings 2022-02-20 03:13:45 +00:00
Adam Turner
6bb7b891a1 Remove copyright and licence fields 2022-02-20 03:06:23 +00:00
Adam Turner
5694e0ce60 Fix module docstring indentation 2022-02-20 00:35:13 +00:00
Adam Turner
4f5a3269a6 Fix module docstring first line 2022-02-20 00:11:08 +00:00
Adam Turner
6b8bccec59 Remove module titles in docstrings 2022-02-19 23:17:29 +00:00
Takeshi KOMIYA
8b23f6db12 Merge commit '07110b7557a552ecfe702bdd6a2d2f9685cb1af9' 2022-02-14 03:03:40 +09:00
Takeshi KOMIYA
5be4f47d85 Fix #10121: html: <div> tag for admonition is not closed w/ docutils-0.18
Since v0.18, docutils has output <aside> tag to represent admonitions.
On the other hand, our custom HTML Writer overrides the handler for
admonition nodes halfly.  As a result, the opening and closing tags
become mismatched.  This fully overrides the handler to use <div> tag to
represent admonitions.
2022-01-26 22:59:52 +09:00
Pradyun Gedam
bc635627d3
Change "Permalink to this {headline -> heading}"
"heading" is a better word to use in this tooltip, since it better
matches the use case.
2022-01-02 18:32:30 +05:30
Takeshi KOMIYA
ce8039db1f Merge branch '4.x' 2022-01-01 20:04:19 +09:00
Takeshi KOMIYA
f38bd8e952 Merge branch '4.3.x' into 4.x 2022-01-01 20:02:10 +09:00
Takeshi KOMIYA
6ee3dd1968 Merge branch '4.x' 2022-01-01 19:02:09 +09:00
Takeshi KOMIYA
b84771dcd2 A happy new year! 2022-01-01 18:45:03 +09:00
Takeshi KOMIYA
5b7f7f825d refactor: Remove RemovedInSphinx50Warning (partially) 2021-12-17 02:12:00 +09:00
James Knight
75914c67c7 drop translator-specific unknown_visit calls
Removes the need for various translators from raising a
`NotImplementedError` exception when missing support for a specific node
type. docutils will already raise [1][2] a `NotImplementedError`
exception for these cases. This help reduce the implementation inside
Sphinx as well as prevents the possible undesired replication of
unknown-node handling with third-party extensions [3].

In most cases, generating a warning message for an unsupported node type
can be preferred. Providing an indication that a node is not supported
can be easier for a user of Sphinx to understand a limitation of a
builder over a generic "not implemented" exception. This commit takes
the logging call which is already used by `texinfo` and applies it to
the `SphinxTranslator` base class -- which any Sphinx translator
implementation can use.

[1]: https://repo.or.cz/docutils.git/blob/d169015ee0f412cffd69b33654d8a119d99bc0f3:/docutils/nodes.py#l2048
[2]: https://repo.or.cz/docutils.git/blob/53716a13b48128af6045139d3cd2909f61e7ed8e:/docutils/nodes.py#l1897
[3]: https://github.com/sphinx-doc/sphinx/issues/9921

Signed-off-by: James Knight <james.d.knight@live.com>
2021-12-05 15:03:57 -05:00
Takeshi KOMIYA
ffb747f7db Fix a mypy warning 2021-11-23 02:48:39 +09:00
Evan Bolyen
836324bf4c BUG: prevent automatic inline conversion by class 2021-11-22 09:36:30 -07:00
Takeshi KOMIYA
dd2ff3e911 Fix #9710: html: Wrong styles for even/odd rows in nested tables 2021-10-09 16:35:31 +09:00
Johannes Aalto
b2bd115dc8 Fix local file download by encoding URL
Properly encode links to files with special characters for the user to
actually be able to download them.

The issue still remains for image files but the logic path
is quite different than with other files fix might involve changes
to docutils.

Fixes sphinx-doc/sphinx#3097

Signed-off-by: Johannes Aalto <ext-johannes.aalto@vaisala.com>
2021-09-24 20:34:09 +03:00
Louis Maddox
515f46ce40
Typo fix in sphinx.writers.html5 docstring 2021-07-18 19:38:26 +01:00
Takeshi KOMIYA
f40c2837dc
Merge pull request #9225 from doerwalter/typehint-html
Add HTML markup to method/function return typehint
2021-07-11 12:03:40 +09:00
Joe Nelson
13d59bc174 Provide more semantic structure for screen-readers
https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA12
2021-06-17 15:03:34 -05:00
Walter Doerwald
9aedeee538 Remove configuration option html_signaturereturn_icon. 2021-06-14 14:02:19 +02:00
Walter Doerwald
b079543405 Add configuration option html_signaturereturn_icon for the arrow before a return type hint. 2021-05-16 12:13:17 +02:00
Walter Doerwald
cf2d5b3f32 Rename CSS classes for return type hint HTML markup.
Wrap the complete type hint in a additional <span> to enable showing the
typehint as a popup on hover.

Port changes to sphinx/writers/html.py.
2021-05-16 12:00:00 +02:00
Walter Doerwald
643131a98b Add HTML markup to the return type hint. 2021-05-16 12:00:00 +02:00
Jakob Lykke Andersen
b0a2e5cf04 Decl styling, consistent monospace 2021-04-12 19:07:41 +02:00
Jakob Lykke Andersen
98800be904 Decl styling, make desc_inline node
Use the new node for cpp:expr
2021-04-12 19:06:44 +02:00
Jakob Lykke Andersen
e012c93f1b Decl styling, move static classes to addnodes from HTML5 writer 2021-04-12 19:05:58 +02:00
Jakob Lykke Andersen
d131ec7acb Decl styling, move desc dynamic classes to domain base class 2021-04-12 19:05:58 +02:00
Jakob Lykke Andersen
3c9a74cb0b Decl styling, docs and restructuring 2021-04-12 19:05:58 +02:00
Takeshi KOMIYA
ce5d66e618
Merge pull request #9053 from tk0miya/title_node_for_toctree_caption
Fix #8870: Use title node for the caption of toctree
2021-04-09 01:35:46 +09:00
Takeshi KOMIYA
5604f9c420 Fix #8870: Use title node for the caption of toctree
Since docutils-0.17, the caption node should not use for the non-figure
nodes.  Therefore, this replaces it by the title node.
2021-04-09 01:02:29 +09:00
Takeshi KOMIYA
dd24a4ef2d refactor: Use PEP-526 based variable annotation (sphinx.writers) 2021-03-13 16:20:09 +09:00
jfbu
fbafb308b8 Merge branch '3.x' into master_with_merged_3.x 2021-02-02 18:01:55 +01:00