summaryrefslogtreecommitdiff
path: root/sphinx/highlighting.py
Commit message (Collapse)AuthorAgeFilesLines
* Include source in highlighting warnings (#11150)Jeremy Maitin-Shepard2023-03-171-2/+2
| | | | | | | | | | | | | If pygments fails to lex a source string as the specified highlight language, Sphinx prints a warning. Previously, that warning did not include the actual source text, although it does include location information. However, in some cases the location information may be missing, there may be multiple highlighted literals on the same line, or the rST is automatically generated somehow. In such cases, it can be difficult to determine the source text that led to the error. With this change, the source text is included in the warning.
* Adopt ``profile = "black"`` for ``isort``Adam Turner2023-01-071-2/+9
| | | | This allows using Ruff's import sorting fixers
* Run pyupgrade (#11070)Adam Turner2023-01-021-2/+2
|
* Use PEP 604 typesAdam Turner2023-01-011-4/+4
|
* Use PEP 595 typesAdam Turner2023-01-011-6/+6
|
* Insert ``from __future__ import annotations``Adam Turner2023-01-011-0/+2
|
* Fix highlighting lexersAdam Turner2022-09-251-0/+2
| | | | - Ensure `pycon3` is always normalised to `pycon`
* Remove Pygments compatability code (#10812)Adam Turner2022-09-091-28/+5
|
* Improve static typing strictness (#10569)danieleades2022-07-181-4/+4
|
* Fix #10506 (again): replacements to Pygments escapesJean-François B2022-07-021-4/+31
| | | | Relates: pygments/pygments#2172
* LaTeX: fix #10506 (make Pygments \PYG macro \protected)Jean-François B2022-06-301-2/+7
|
* Collapse single line docstringsAdam Turner2022-02-201-2/+1
|
* Remove copyright and licence fieldsAdam Turner2022-02-201-3/+0
|
* Fix module docstring indentationAdam Turner2022-02-201-2/+2
|
* Fix module docstring first lineAdam Turner2022-02-201-2/+1
|
* Remove module titles in docstringsAdam Turner2022-02-191-3/+0
|
* A happy new year!Takeshi KOMIYA2022-01-011-1/+1
|
* Replace distutils.versions.LooseVersion by packaging.version.VersionTakeshi KOMIYA2021-11-071-2/+2
| | | | | | | Distutils module are now deprecated and will be removed in Python 3.12. This replaces it by packaging module and reduces the dependency to it. refs: #9820
* refactor: Use PEP-526 based variable annotationTakeshi KOMIYA2021-04-081-4/+4
|
* Mention pygments_style in sphinxhighlight.styjfbu2021-02-131-0/+1
|
* LaTeX, better workaround for a Pygments <= 2.7.4 line spacing issuejfbu2021-02-131-0/+15
| | | | | | Closes: #8874 Relates #4249
* A happy new year!Takeshi KOMIYA2021-01-011-1/+1
| | | | | | | .. 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
* Sort imports with isortFrançois Freitag2020-11-111-5/+3
| | | | | | | | | | | | 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.
* Fix #7139: ``code-block:: guess`` does not workTakeshi KOMIYA2020-02-121-6/+1
|
* Merge branch '2.0'Takeshi KOMIYA2020-01-011-3/+3
|\
| * A happy new year!Takeshi KOMIYA2020-01-011-1/+1
| |
| * mypy: Enable disallow_incomplete_defs flag for type checkingTakeshi KOMIYA2019-12-301-2/+2
| |
* | Merge branch '2.0'Takeshi KOMIYA2019-12-251-18/+12
|\ \ | |/
| * Migrate to py3 style type annotation: sphinx.highlightingTakeshi KOMIYA2019-12-251-21/+13
| |
* | Merge branch '2.0'Takeshi KOMIYA2019-12-161-0/+1
|\ \ | |/
| * LaTeX: avoid quotes and TeX ligature replacements in PDF outputjfbu2019-12-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refs: #6890 The comma character is not TeX-escaped because it is frequent in general text and escaping it would make the LaTeX output larger for only dealing with the problem of the LaTeX-ligature of ,, into a single character. And one there is problem with the commas in options to Verbatim from PygmentsBridge. The hyphen character is escaped (not in ids and URIs!) to \sphinxhyphen{} for both Unicode and non-Unicode engines. This is needed to work around hyperref transforming -- and --- from section titles into EN DASH resp. EM DASH in PDF bookmarks. https://github.com/latex3/hyperref/issues/112 Note to expert LaTeX users: if Sphinx latex user with xelatex has - turned off Smart Quotes for some reason, - but does want TeX ligatures and thus overrode Sphinx latex_elements['fontenc'] default (since #6888) to this effect, then this should be added to LaTeX preamble: \def\sphinxhyphen#1{-}% (\protected is now not needed) \let\sphinxhyphenforbookmarks\sphinxhyphen
* | Merge branch '2.0'Takeshi KOMIYA2019-11-301-4/+2
|\ \ | |/
| * Make escape() and hlescape() as public APIs of texescapeTakeshi KOMIYA2019-11-161-5/+3
| |
* | Fix flake8 violationTakeshi KOMIYA2019-11-171-1/+1
| |
* | Merge branch '2.0'Takeshi KOMIYA2019-11-171-4/+6
|\ \ | |/
| * Fix #6738: latex: literal_block does not support raw unicode charactersTakeshi KOMIYA2019-11-161-4/+7
| |
* | Merge branch '2.0'Takeshi KOMIYA2019-08-191-1/+2
|\ \ | |/
| * Switch uses of __import__ to importlib.get_module()Jon Dufresne2019-08-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Python docs for __import__ recommend using importlib.get_module(). https://docs.python.org/3/library/functions.html#__import__ > Note: This is an advanced function that is not needed in everyday > Python programming, unlike importlib.import_module(). As importlib.get_module() uses the Python module cache and returns the module, this also allows simplifying many module cache checks of use of sys.modules. importlib.get_module() has been available since Python 3.3.
* | Merge branch '2.0'Takeshi KOMIYA2019-06-211-1/+2
|\ \ | |/
| * Fix #6497: custom lexers fails highlighting when syntax errorTakeshi KOMIYA2019-06-181-1/+2
| |
* | Merge commit '54d5fcfaebc3364044761d30c0fed6bd4d3052c3'Takeshi KOMIYA2019-06-021-30/+41
|\ \ | |/
| * Add :force: option to code directivesTakeshi KOMIYA2019-06-011-14/+15
| |
| * highlight: Enable raiseonerror only if force=FalseTakeshi KOMIYA2019-06-011-29/+38
| |
* | Merge branch '2.0'Takeshi KOMIYA2019-05-131-15/+27
|\ \ | |/
| * refactor: Add PygmentsBridge.get_style() and .get_lexer()Takeshi KOMIYA2019-05-121-15/+27
| |
* | Drop features and APIs deprecated in 1.8Takeshi KOMIYA2019-03-301-31/+2
|/
* Clean up import for annotationsTakeshi KOMIYA2019-03-061-1/+1
|
* Merge branch '1.8'Takeshi KOMIYA2019-01-021-1/+1
|\
| * A happy new year!Takeshi KOMIYA2019-01-021-1/+1
| |
* | Replace use of six.text_type with strJon Dufresne2018-12-181-2/+1
| | | | | | | | | | This removes the last use of the six package allowing Sphinx to remove it as a dependency.