| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
* add Terminal Tips Documentation - Issue #2131
* add newlines after ::, typo
* Add highlight directive
---------
Co-authored-by: Jean Abou Samra <jean@abou-samra.fr>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Devolve Contributing.md
Move the content to the docs and website so it is displayed on
pygments.org, to make it easier to find.
- Regex dos and don'ts go to lexerdevelopment.rst
- The rest goes to a new file contributing.rst
- That makes the explanation of how lexers are tested in
lexerdevelopment.rst redundant, so remove it. The bit on how to add a
lexer goes to contributing.rst.
|
|
|
|
|
|
|
|
| |
Due to a wrong reST header, there were two top-level headers on that
page, leading to the subtitle “Style rules” being displayed on
https://pygments.org/docs/ as if it were a separate section.
Also harmonize the title.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Porting notes:
- tox handles Python environments automatically. Remove a bit of PYTHONPATH
manipulation (that was using Python 2 code which always failed!)
- No `clean` target: `git clean -xdf` should fit the bill.
- No `reindent` target: the `reindent.py` script it was using does not
exist (anymore?).
- No equivalent of tox-test-coverage, which was an artifact of the past,
using nose. Instead, the test-coverage target only is ported, which
uses pytest, and works.
|
| |
|
|
|
|
|
|
| |
* Copy the security paragraph to security.rst
* Fix missing maintainer in docs/index.rst
* Fix incorrect emphasis markup
|
|
|
|
|
| |
Explain that adding styles to the source tree directly is something that
should be only used by contributors.
|
|
|
|
|
|
|
|
|
|
|
| |
* Register new style
* Replace default_style with Token
#2184
* Remove default_style from styles
* Simplify register style code
|
|
|
|
|
|
|
| |
* Add Name.Property token missing from docs
* Add Comment.PreprocFile token missing from docs
* Add Punctuation.Marker token to tokens dict
|
| |
|
| |
|
|
|
|
|
|
| |
For the pygmentize command line, this pull request adds detection of true-color support on the terminal and makes that the default formatter. It looks up the COLORTERM environment variable having a value of truecolor or 24bit. If that is the case, it sets the default formatter to use the TerminalTrueColorFormatter.
The COLORTERM environment variable is a convention that has been adopted by some terminals for specifying true-color is supported.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Switch from pkg_resources to importlib.metadata
importlib.metadata is a standard library replacement for
pkg_resources, available starting with Python 3.8. It is faster than
pkg_resources. This lets the plugin interface use it when available,
i.e. on Python 3.8 and later. On earlier Python, it uses the
importlib_metadata PyPI backport if available, and finally falls back
on pkg_resources. setup.cfg gains an extra called plugins, which can
allow a project to install "pygments[plugins]" in order to ensure that
plugins support is present even if installed with older Python
versions.
Timings for lexing an empty file with a lexer from a random plugin:
Before:
real 0m0,238s
user 0m0,210s
sys 0m0,029s
After:
real 0m0,141s
user 0m0,125s
sys 0m0,017s
Fixes #2116, #2126
|
| |
|
|
|
|
|
|
|
|
| |
This commit adds a new url field to a lexer, which can be used to link
to the language website, instead of relying on having the link in either
languages.rst or the docstring of the lexer. Additionally, it changes the
languages.rst file to auto-generate the list of lexers from the actual
source code, using the provided URL.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a tooltips option to HtmlFormmater.
* Rename option tooltips to debug_token_types.
* Use explicit if block.
* Fix check.
* Document how to use the new debug_token_types option for the HTML formatter.
* Remove output redirection from example call.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* NF: adding an example of use of simple filter
@simplefilter is great, but also not very intuitive. Indeeds, the syntax seems
to indicate that you define a function with four arguments while in reality you
define a class whose constructor takes arbitrary keyword arguments. I believe in
this case an example to show how to instantiate this filter is really necessary.
Regarding simplefilter, I also believe that it could be improved in two simple
ways:
* accepting any method which takes lexer and stream as a filter. That would be
sufficient as long as there is no option
* the @simplefilter decorator could deal with `self` so that the user do not
have to add it themselves. Probably not worth doing it no, as it would break
compatibility with current version, but would be even simpler to use
* NF: clarifying get_..._options
get_bool_opt's documentation seems to indicate that the key is interpreted as a
Boolean. While a quick look at the code shows clearly that the value associated
to the key is what is interpreted as a Boolean. I hope I made the code clearer
to any people who know python by indicating that it is essentially `.get` but
with extra features
* NF: clarifying Filter
`filter` has already a specific behavior in general python, or for any people
used to functional programing (and even if some dom processor). So indicating
that a filter is not something that remove some tokens seems really useful to
try to explain what is going on.
* NF: adding details regarding states in lexer
I found the state explanation confusing. I do know what a state machine
is. However, reading the code, I first thought that there were two distinct
variables:
* the current state
* the stack
that are somehow related but distinct. Explaining that the current state is the
top of the stack was lacking in my opinion. That also help explain #push. In
particular that if you define in state "s" an operation whose new state is
"#push", the behavior can be quite different than if the new state was "s".
|
|
|
|
| |
Co-authored-by: Georg Brandl <georg@python.org>
|
| |
|
|
|
| |
Add documentation for the -N, -g, -s and --json command line options.
|
|
|
|
|
|
|
|
|
|
| |
Support both single carets for syntax errors (Python 2 and 3)
and fine-grained error locations with several carets (Python 3.11+).
Previously, the carets were highlighted as operators. This uses
a new token, Token.Punctuation.Marker. For now, no style supports
it specifically. In the future, styles might start differentiating
it from Token.Punctuation.
[Closes #1850.]
|
|
|
|
|
| |
* uniformize aliases order
* LighttpdConfLexer: add lighttpd.conf filename
|
|
|
|
| |
Reference: #1571
|
| |
|
|
|
| |
Command was not including the line numbers, missing `linenos=1` option.
|
|
|
|
| |
docs to point to both snippets and examplefiles.
|
|
|
| |
Co-authored-by: Georg Brandl <georg@python.org>
|
|
|
| |
see #1660
|
| |
|
| |
|
|
|
|
| |
closes #1518
|
|
|
|
|
|
| |
* Fix link
* here too
|
| |
|
|
|
|
| |
Add a contributing guide for newcomers, and remove references to pygmentize in the development docs. During development, there is no pygmentize.
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
Change ansi color names to more saying names
Approved-by: Morten E. Lund <melund@gmail.com>
Approved-by: jonathanslenders <jonathan@slenders.be>
Approved-by: Anteru <bitbucket@ca.sh13.net>
|
| |
| |
| |
| |
| |
| | |
The ansi color names are changed to names which are easier to understand and align with color names of other projects and terminals. (e.g. ``#ansifuchsia`` to ``ansibrightmagenta``)
This also drops the # prefix to the color names. Hashtag # is usually used for hex colors and the names are already prefixed with `ansi`. Furthermore, it allows the new and old set of names to be exclusive.
|