Commit Graph

39 Commits

Author SHA1 Message Date
Adam Turner
7e9a2066c2 Be more ephemeral (in anchor link title text) 2023-08-12 05:30:38 +01:00
Adam Turner
1cfb68d8be
Consistently name the object description options (#11533)
*  The directive option ``:noindex:`` was renamed to ``:no-index:``.
*  The directive option ``:noindexentry:`` was renamed to ``:no-index-entry:``.
*  The directive option ``:nocontentsentry:`` was renamed to ``:no-contents-entry:``.

The previous names are retained as aliases, but will be deprecated
and removed in a future version of Sphinx (9.0 or later).
2023-07-28 22:30:26 +01:00
latosha-maltba
97d2c5da2f
Add the `:no-typesetting:` option for only creating targets (#10478)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-28 19:43:27 +01:00
TLouf
86b07d4a97
Allow multi-line object description signatures (#11011)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Jean-François B <2589111+jfbu@users.noreply.github.com>
Co-authored-by: TLouf <loufthomas@gmail.com>
2023-05-11 14:28:57 +01:00
Jeremy Maitin-Shepard
8de6638697
Add `content_offset parameter to nested_parse_with_titles` (#11147)
Previously, ``nested_parse_with_titles`` always passed ``0`` as the input
offset when invoking ``nested_parse``.  When parsing the content of a
directive, as is a common use case for ``nested_parse_with_titles``,
this leads to incorrect source file/line number information, as it
does not take into account the directive's ``content_offset``, which is
always non-zero.

This issue affects *all* object descriptions due to GH-10887.  It also
affects the ``sphinx.ext.ifconfig`` extension.

The ``py:module`` and ``js:module`` directives employed a workaround for
this issue, by wrapping the calls to ``nested_parse_with_title`` with
``switch_source_input``.  That worked, but was more complicated (and
likely less efficient) than necessary.

This commit adds an optional ``content_offset`` parameter to
``nested_parse_with_titles``, and fixes callers to pass the appropriate
content offset when needed.

This commit eliminates the now-unnecessary calls to
``switch_source_input`` and instead specifies the correct ``content_offset``.
2023-02-15 05:45:28 +00:00
Adam Turner
a13cf2c24d Adopt `profile = "black" for isort`
This allows using Ruff's import sorting fixers
2023-01-07 18:31:15 +00: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
05a898ecb4 Migrate to Node.findall() from Node.traverse()
Node.traverse() was marked as deprecated since docutils-0.18.  Instead
of it, Node.findall() has been added as successor of traverse().

This applies a patch to docutils-0.17 or older to be available
Node.findall() and use it.
2022-01-03 00:35:29 +09:00
Takeshi KOMIYA
b84771dcd2 A happy new year! 2022-01-01 18:45:03 +09:00
Jakob Lykke Andersen
a64196f048 js/py nodes, update arglist rendering 2021-10-03 10:17:31 +02:00
Jakob Lykke Andersen
06d3d7356e js nodes, update name rendering 2021-10-03 10:17:31 +02:00
Jakob Lykke Andersen
37083fcc1a js nodes, update display_prefix 2021-10-03 10:17:31 +02: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
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
Jakob Lykke Andersen
18b3e3c450 Add tests for noindexentry 2020-07-05 09:17:20 +02:00
Takeshi KOMIYA
7aa5584a47 Fix #7301: capital characters are not allowed for node_id 2020-03-29 23:55:56 +09:00
Takeshi KOMIYA
7bbf79c313 Fix #7301: Allow . and _ for node_id
In development of 3.0, Sphinx starts to obey to the rule of
"Identifier Normalization" of docutils.  This extends it to allow
dots(".") and underscores("_") for node identifier.

It allows Sphinx to generate node identifier from source string as
possible as it is (bacause dots and underscores are usually used in
many programming langauges).

This change will keep not to break hyperlinks as possible.
2020-03-22 16:39:00 +09:00
Takeshi KOMIYA
8f647643fb js domain: Generate node_id for objects in the right way 2020-03-01 01:46:18 +09:00
Takeshi KOMIYA
dc33b6ef82 test: Add testcase for js domain 2020-02-15 00:35:09 +09:00
Takeshi KOMIYA
eaf495c3c4 A happy new year! 2020-01-01 14:27:43 +09:00
Takeshi KOMIYA
c83f2a0272 Fix #6140: Use unittest.mock instead of mock 2019-03-08 00:27:45 +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
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
Takeshi KOMIYA
f7027049b1 Fix flake8 violations 2018-02-19 23:20:56 +09:00
Takeshi KOMIYA
2426cedb8b A happy new year! 2018-01-01 01:06:58 +09:00
shimizukawa
d497d74370 refs #3458: add sphinx.testing that are moved from /tests directory. 2017-05-14 20:47:15 +09:00
Takeshi KOMIYA
56d3458584 Fix flake8 violations 2017-05-09 21:57:36 +09:00
Takeshi KOMIYA
96fa6d2972 Implement get_full_qualified_name() to JavascriptDomain (refs: #3630) 2017-04-23 16:31:33 +09:00
Takeshi KOMIYA
3e46f52a96 Merge pull request #3475 from agjohnson/domain-js-add-nesting
Add nesting, package directive, and method directive to JavaScript domain
2017-03-26 18:16:04 +09:00
Takeshi KOMIYA
c57e47e042 Year++ 2017-03-26 11:49:34 +09:00
Anthony Johnson
fb3953698b
Remove JS domain module feature for null module names 2017-03-20 13:38:23 -07:00
Anthony Johnson
3ba60ffd5d Add nesting, module directive, and method directive to JavaScript domain
* Adds nesting to the JavaScript domain, to allow for nesting of elements
* Adds the ``js:module`` directive, which behaves similarly to the Python
  directive
* Adds the ``js:method`` directive, an alias to ``js:function``
* Adds roles for ``js:mod`` and ``js:meth``
* Updates tests to passing cases
* Adds docs for new features
2017-03-15 22:27:48 -07:00
Anthony Johnson
3502336b13
Add tests for xrefs on Python and JavaScript domains
These are just the passing test cases for the domains currently. I am going to
patch up issues with nesting on both domains to start, so these are the test
cases I'll be testing against. I'll see about addressing the other core
domains, or at very least the cpp domain, with similar tests if this looks
okay.

So far, these tests only test against methods/functions for the basic nesting
structure. More complete tests will test additional domain roles.

Refs #662
2017-03-05 16:00:25 -08:00