summaryrefslogtreecommitdiff
path: root/sphinx/highlighting.py
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | Remove unnecessary encoding cookie from Python source filesJon Dufresne2018-12-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | refactor: Remove u-prefix from stringsTakeshi KOMIYA2018-12-161-3/+3
| |
* | Replace pycompat.htmlescape() by html.escape()Takeshi KOMIYA2018-12-161-2/+2
| |
* | Replace all "unicode" type by "str"Takeshi KOMIYA2018-12-151-7/+6
| |
* | Move to py3 mode for mypy (and remove many "type: ignore" comments)Takeshi KOMIYA2018-12-151-1/+1
| |
* | Add sphinx.util.typing:unicode to help mypy-3 migrationTakeshi KOMIYA2018-11-241-0/+1
| |
* | Always prefer dict literals over calls to dict()Jon Dufresne2018-11-131-9/+9
| | | | | | | | | | Dict literals are always slightly faster and are idiomatic modern Python.
* | Merge branch '1.8'Takeshi KOMIYA2018-11-011-2/+2
|\ \ | |/
| * Fix #5471: Show appropriate warning for deprecated APIsTakeshi KOMIYA2018-10-171-2/+2
| |
* | Merge branch '1.8'Takeshi KOMIYA2018-10-161-2/+2
|\ \ | |/
| * Fix mypy violationsTakeshi KOMIYA2018-10-161-2/+2
| |
* | Remove unnecessary object from class definitionsJon Dufresne2018-09-111-1/+1
|/ | | | | In Python 3, all classes are new-style classes. The object in the definition is redundant and unnecessary.
* Apply :confval:`trim_doctest_flags` to all builders (cf. text, manpages)Takeshi KOMIYA2018-07-211-2/+6
|
* ``sphinx.highlighting.PygmentsBridge.unhighlight()`` is deprecatedTakeshi KOMIYA2018-07-211-0/+5
|
* Remove unused codeTakeshi KOMIYA2018-07-201-2/+0
| | | | | Now sphinx depends on pygments-2.0 or higher. So this code is not passed.
* Merge branch '1.7'Takeshi KOMIYA2018-03-181-3/+2
|\