Commit Graph

112 Commits

Author SHA1 Message Date
Adam Turner
b91f6617ed Enable Ruff's pylint 'PLC2201' check
Address all cases where the comparison order check is violated
2022-12-30 00:06:11 +00:00
Adam Turner
24e3b7c8c8 .read_text() -> .read_text(encoding='utf8') 2022-04-27 03:04:19 +01:00
Adam Turner
e2595b6cbe Review: Use list 2022-04-24 17:55:05 +01:00
Adam Turner
35ed39c946 Use Node.findall 2022-04-22 04:21:39 +01:00
Takeshi KOMIYA
e571479d54 Fix #10318: literalinclude: :prepend: option working with :dedent:
It will always be warned because prepending is processed before
dedenting.  This changes the order of processing options.
2022-04-02 23:39:47 +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
e2f141620d Fix a flake8 warning 2022-01-15 20:01:30 +09:00
Takeshi KOMIYA
6611140c76 Merge branch '4.x' into HEAD 2022-01-15 19:46:45 +09: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
Latosha Maltba
cf9b5b5be9 Add tests for :dedent: option of code-block directive 2021-09-21 09:19:53 +00:00
Takeshi KOMIYA
84dc65ad51 html: html_codeblock_linenos_style defaults to 'inline' (refs: #7849)
As discussed in #7879, the default style of line numbers for code
blocks in HTML output becames 'inline' by default.  And 'table' style
is now deprecated and will be removed in Sphinx-6.0.
2021-01-26 01:42:17 +09:00
Takeshi KOMIYA
fddc42847f Fix #2030: automatic dedent support in code-block directive 2021-01-13 01:10:28 +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
4dd8b1022f test: Use read_text() and read_bytes() 2020-02-01 11:58:51 +09:00
Takeshi KOMIYA
eaf495c3c4 A happy new year! 2020-01-01 14:27:43 +09:00
Takeshi KOMIYA
faedcc48cc Fix #6887: Sphinx crashes with docutils-0.16b0 2019-12-14 13:33:12 +09:00
Takeshi KOMIYA
39b166b6b9 Fix #6742: end-before option of literalinclude skips first line 2019-10-28 19:16:20 +09:00
Takeshi KOMIYA
95723aa6f6 Fix flake8 violations 2019-07-01 00:28:30 +09:00
Takeshi KOMIYA
e001d358d0 Add :force: option to code directives 2019-06-01 13:42:57 +09:00
James Knight
3858a62814 test: verify linenothreshold usage
Adding a unit test to verify the use of the `linenothreshold` option
provided by the `highlight` directive [1]. The included document to test
will introduce two sets of `code-block` and `literalinclude` directives
where the first entry generates contents using line numbers and the
second entry generates contents not using line numbers, respectfully.

[1]: https://github.com/sphinx-doc/sphinx/blob/v1.8.4/sphinx/transforms/post_transforms/code.py#L85

Signed-off-by: James Knight <james.d.knight@live.com>
2019-02-16 22:14:30 -05:00
Takeshi KOMIYA
6ca669295c Close #1851: Allow to omit an argument for code-block directive 2019-02-04 01:50:44 +09:00
Takeshi KOMIYA
68c90a26f1 quickstart: Simplify generated conf.py (for latex) 2019-01-07 23:06:14 +09:00
Takeshi KOMIYA
c4c878303f encoding keyword for path.text() and path.write_text() is no longer needed 2019-01-03 10:58:07 +09:00
Takeshi KOMIYA
5428d94d24 Remove coding magic comments from tests 2019-01-02 21:53:07 +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
Takeshi KOMIYA
d8b69c7f98
Merge pull request #5819 from jdufresne/coding-comment
Remove unnecessary encoding cookie from Python source files
2018-12-17 19:15:00 +09:00
Jon Dufresne
e9c87b3d13 Fix invalid escape sequence in test_directive_code.py
Fixes error when running tests:

tests/test_directive_code.py:359
  sphinx/tests/test_directive_code.py:359: DeprecationWarning: invalid escape sequence \s
    includes = '\\end{sphinxVerbatim}\n\sphinxresetverbatimhllines\n'
2018-12-17 11:11:41 +01:00
Jon Dufresne
d210da96f6 Fix invalid escape sequence in test_directive_code.py
Fixes error when running tests:

tests/test_directive_code.py:359
  sphinx/tests/test_directive_code.py:359: DeprecationWarning: invalid escape sequence \s
    includes = '\\end{sphinxVerbatim}\n\sphinxresetverbatimhllines\n'
2018-12-16 13:37:47 -08: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
jfbu
30ec4b6bba Merge branch '1.8' 2018-12-16 18:34:05 +01:00
jfbu
88a019dc99 LaTeX: allow sphinxVerbatim usage without explicit "hllines" extra setup
Fixes: #5810
2018-12-16 16:54:28 +01:00
Takeshi KOMIYA
c6bd84a614 refactor: Remove u-prefix from strings 2018-12-16 21:28:51 +09:00
Takeshi KOMIYA
ba83214386 Refactor: Add Config.read() as a constructor
To simplify Config.__init__() method, this separates conf.py parsing
feature to Config.read() method.
This allows to instantiate config object simply.
2018-03-23 23:40:28 +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
jfbu
70f8d4ddfc Support `:emphasize-lines:` in PDF output (closes #1238) 2017-12-10 12:37:36 +01:00
Andy Neebel
f68c108f10 Mark tests as xfail/skip to allow successful run 2017-06-14 13:27:31 -05: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
1dea386bc4 Fix #3108: Show warning if :start-at: and other literalinclude options does not match to the text 2017-03-26 18:13:50 +09:00
Takeshi KOMIYA
8f9dd64992 Merge branch 'stable' 2017-03-26 11:52:15 +09:00
Takeshi KOMIYA
c57e47e042 Year++ 2017-03-26 11:49:34 +09:00
Ray Lehtiniemi
06b6e07b98 Add tests
Signed-off-by: Ray Lehtiniemi <rayl@mail.com>
2017-03-11 13:40:47 -07:00
Takeshi KOMIYA
675b5f4237 literalinclude directive allows combination of :pyobject: and :lines: 2017-02-22 00:29:24 +09:00