summaryrefslogtreecommitdiff
path: root/pygments/formatters
Commit message (Collapse)AuthorAgeFilesLines
* Improve HTML formatter output.improve-linenos-handlingMatthäus G. Chajdas2020-07-311-4/+8
| | | | | | | | | | | | | | | With the previous changes, we started to emit one <pre> per line for line numbers. This breaks for instance the Sphinx-RTD-Theme, which expects the line numbers to be formatted the same way as the normal content. This commit makes the following changes: * Emit a single <pre> inside the linenos div * Wrap individual lines into <span> as needed * Update all tests * Don't yield empty <span> elements when no style is specified This also makes the .html test files look correct when looked at with a browser, as there is no extra whitespace in them which needs stripping.
* Fix Solarized line number colors (#1477)Paweł Fertyk2020-07-041-91/+142
| | | | | | | | | | | | | | | | | * Add font and background colors to Style * Move all styles to get_style_defs, add tests * Remove hardcoded styles, add special lineno style * Add styles for special line numbers in tables * Update noclasses documentation * Refactor linenos elements and styles, add tests * Update AUTHORS * Fix multiple CSS prefixes, add tests
* Improve font handling code.Matthäus G. Chajdas2020-03-031-6/+9
| | | | | * Fix an issue raised in the review -- don't raise None no matter what. * Remove a few variables to make the control flow easier to understand
* Fix #1247 by looking up in both HKLM and HKCU.Matthäus G. Chajdas2020-03-021-23/+32
| | | | | | This is slightly different from the code posted inside the issue: * Use finally to close the registry key no matter what * Don't use break, but return directly on the first hit
* Remove Python 2 compatibility (#1348)Georg Brandl2020-02-297-32/+17
| | | | | | | | | | | * Remove Python 2 compatibility * remove 2/3 shims in pygments.util * update setup.py metadata * Remove unneeded object inheritance. * Remove unneeded future imports.
* Update many links to use HTTPS and skip redirectsKurt McKee2019-12-181-2/+2
|
* Merge branch '582/joshuagryphon/svglinenos'Matthäus G. Chajdas2019-12-011-3/+37
|\
| * Right-align line numbers in the SVG formatter.Matthäus G. Chajdas2019-12-011-3/+3
| |
| * Merge branch 'master' into 582/joshuagryphon/svglinenosMatthäus G. Chajdas2019-12-011-2/+2
| |\
| * | svg formatter can now add configurable linenumbersJoshua Griffin Dunn2019-11-281-3/+37
| | |
* | | allow terminal256 formatter to show italics...Kurt Neufeld2019-12-011-2/+12
| |/ |/| | | | | | | | | | | | | | | | | | | OSX users will have to follow instructions at: http://www.eddieantonio.ca/blog/2015/04/16/iterm-italics/ tldr; infocmp xterm-256color > /tmp/xterm-256color.terminfo echo 'sitm=\E[3m, ritm=\E[23m,' >> /tmp/xterm-256color.terminfo tic /tmp/xterm-256color.terminfo make sure iTerm2.settings.profiles.terminal.terminal type=xterm-256color
* | use IOError reason in error messageGeorg Brandl2019-11-291-2/+2
|/
* html formatter: lineseparator needs to be unicodeGeorg Brandl2019-11-261-1/+1
| | | | Fixes #1053
* Update project to use modern Python features and idiomsJon Dufresne2019-11-251-2/+2
| | | | | | | | | | Run the pyupgrade tool across the project to use modern language features. - Use set literals - Use dict comprehension - Remove unnecessary numeric indexes in format string - Remove unnecessary extra parentheses
* formatters.other: style/import fixupsGeorg Brandl2019-11-251-1/+5
|
* image formatter: actually respect "line_number_separator"Georg Brandl2019-11-241-1/+2
|
* Update TestcaseFormatter.Matthäus G. Chajdas2019-11-161-2/+2
| | | | | We're using pytest now, and that needs slightly different test-case syntax.
* Fix #928.Matthäus G. Chajdas2019-11-161-2/+3
| | | | | We're using Menlo on Mac OS now, and DejaVu Sans Mono on Unix. Also updated the documentation to match the actually used fonts.
* Update img.pyanshks2019-10-221-1/+1
| | | changed font style to DejaVu Sans Mono in DEFAULT_FONT_NAME_NIX
* Fix some typos in comments.Matth?us G. Chajdas2019-07-201-2/+2
|
* Fixup all headers and some more minor problems.2.4.2Georg Brandl2019-05-2811-11/+11
|
* Backed out changeset: df3df829861dMatth?us G. Chajdas2019-05-211-7/+1
|
* Don't emit a trailing newline in nowrap mode (fixes #1514.)Matth?us G. Chajdas2019-05-181-1/+7
|
* Merged in SylvainCorlay/pygments-main/css-variables (pull request #814)Anteru2019-05-091-4/+29
|\ | | | | | | | | | | Allow for CSS variable in pygments stylesheets Approved-by: Anteru <bitbucket@ca.sh13.net>
| * Add license information to generated files (fixes #1496).Matth?us G. Chajdas2019-05-071-2/+11
| | | | | | | | Also update the license year to 2019.
| * Add option to wrap the code in both <code> and <pre> (fixes #438.)Matth?us G. Chajdas2019-05-061-2/+18
| | | | | | | | Adds a new option "wrapcode" which wraps the code using <code>.
* | Allow for CSS variable in pygments stylesheetsSylvain Corlay2019-05-021-3/+8
|/
* Fix ResourceWarning: unclosed fileMicka?l Schoentgen2019-01-072-5/+5
| | | | Also uniformize usage of the 'with' contact manager to prevent resource leaks.
* Merge fix for recently introduced failures.Matth?us G. Chajdas2018-12-192-5/+5
|\
| * Fix a few markup problems in the docs.Georg Brandl2018-12-181-2/+2
| |
| * Update ansi color name change version.Matth?us G. Chajdas2018-12-161-2/+2
| |
| * Merged in mortenlund/pygments-main (pull request #777)Anteru2018-12-161-3/+9
| |\ | | | | | | | | | | | | | | | | | | | | | 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>
| * | Fix more instances of invalid string escapesGeorg Brandl2018-11-281-1/+1
| | | | | | | | | | | | Also, raise on warnings from Pygments only.
* | | Update remaining color namesMorten Enemark Lund2018-12-182-62/+62
| |/ |/|
* | Use replace instead of stripMorten Enemark Lund2018-08-211-2/+2
| |
* | Ensure terminal formatter works with new ansi colors namesMorten Enemark Lund2018-08-211-2/+2
| |
* | Change ansi color names to more saying namesMorten Enemark Lund2018-08-041-1/+7
|/ | | | | | 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.
* -x functionality updates, Python 3 compatibility fixGeorg Brandl2017-01-221-4/+6
|
* Merged in tprynn/pygments-main/command-line-lexer-formatter (pull request #559)Georg Brandl2017-01-2212-12/+49
|\ | | | | | | Custom Lexer/Formatter File Loading
| * style fixupsGeorg Brandl2017-01-221-6/+6
| |
| * Merged in AndreBremer/pygments-main (pull request #597)Georg Brandl2017-01-2212-12/+12
| |\ | | | | | | | | | Image Formatter: Mac-specific lookup for fonts (fixes #868)
| | * Copyright update.Georg Brandl2017-01-2212-12/+12
| | |
| | * Add support for partials and path segments for Handlebars.Christian Hammond2016-11-0412-0/+3295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces support for some missing features to the Handlebars lexer: Partials and path segments. Partials mostly appeared to work before, but the `>` in `{{> ... }}` would appear as a syntax error, as could other components of the partial. This change introduces support for: * Standard partials: `{{> partialName}}` * Partials with parameters: `{{> partialName varname="value"}}` * Ddynamic partials: `{{> (partialFunc)}}` * Ddynamic partials with lookups: `{{> (lookup ../path "partialName")}}` * Partial blocks: `{{> @partial-block}}` * Inline partials: `{{#*inline}}..{{/inline}}` It also introduces support for path segments, which can reference content in the current context or in a parent context. For instance, `this.name`, `this/name`, `./name`, `../name`, `this/name`, etc. These are all now tracked as variables.
| * Python 2.6 compatibility fixes and optimization.abremer2016-05-271-2/+2
| |
| * Added Mac-specific lookup for fonts (fixes #868).abremer2016-05-271-0/+37
| |
* | Add load_from_file functions to __all__ in lexers and formattersTanner Prynn2016-02-291-1/+1
| |
* | bring this branch up-to-date with master, and resolve merge conflicts in ↵Tanner Prynn2016-02-261-0/+33
|\ \ | |/ |/| | | lexerdev documentation
| * Use exec instead of imp.load_sourceTanner Prynn2016-02-261-9/+7
| | | | | | | | Custom lexer/formatter are no longer added to sys.modules()
| * Update pull request per comments by birkenfeld.Tanner Prynn2016-02-241-10/+24
| | | | | | | | | | | | | | Add optional function parameter for the class name to instantiate, and update cli to support this. Move error handling to within the loading functions; they now only raise ClassNotFound. Modify doc with these updates and the version number. Test case clean up and additions.
| * Add additional command line option to prevent users from using eval() on ↵Tanner Prynn2016-02-221-0/+21
| | | | | | | | | | | | | | | | untrusted files Finish custom-formatter loading and fill in some docstrings Add load_?_from_file functions to API documentation pep8 compliance