Questions tagged [pygments]

A generic source code syntax highlighter written in Python.

Pygments is a generic source code syntax highlighter, written in , with support for a wide range of common languages and markup formats. Pygments is the standard syntax highlighter used by the Jekyll blogging platform.

264 questions
0
votes
1 answer

Highlighting the inner code blocks in Django Template Engine with django-pygmentify

I'm using django-pygmentify package in order to highlight my code blocks in my Django templates. The thing is that this package only supports code blocks as input. I have a model field that keeps markdown data. This markdown content might contain…
Sadra
  • 167
  • 1
  • 9
0
votes
2 answers

How to activate Pygments in Pelican?

What I have to do to make it work that simple as in this example from official documentation? :::python print("The triple-colon syntax will *not* show line numbers.") #!python print("The path-less shebang syntax *will* show line numbers.") What…
Alex
  • 153
  • 7
0
votes
1 answer

Pygments and ImageFormatter: set output to 80 columns

The ImageFormatter always creates a PNG output which width depends on the line length. For example, this PNG is 192 pixels wide: and this is 384: Is there a setting in Pygments to emulate a 80 column output, so all images will have the same…
Jander
  • 59
  • 6
0
votes
0 answers

syntax highlighting Tkinter textbox using pygments

I am trying to make a basic code editor in tkinter/python. And i want to add syntax highlighting for the text editor, but i cant find any resources that explain clearly how to add syntax highlighting for a tkinter textbox.. Source code from tkinter…
0
votes
1 answer

is there a way to bind key press to root without disturbing default binds in tkinter

I am trying to add syntax highlighting to the text widget in tkinter i am using the code from another stack overflow question Pygments syntax highlighter in python tkinter text widget i binded the function for syntax hyghlighting to the root but…
0
votes
1 answer

All I want to do is display an asci string in a Panel widget and retain its formatting/color

All I want to do is display an asci string in a Panel widget and retain its formatting/color. What I Want: #here's the string after pygments formatting: test = '\x1b[38;2;0;68;221mTraceback (most recent call last):\x1b[39m\n File…
itwasthekix
  • 585
  • 6
  • 11
0
votes
1 answer

How to include pygments in vimwiki html /smarty file?

I'm using vimwiki which allows me to add a smarty/html template file along with the css. I know how to generate the css file with pygments but the problem is how do I get that css to include all the classes based on the input of the
 tag?
For…
ritchie
  • 405
  • 1
  • 4
  • 12
0
votes
1 answer

cx_Freeze: Python error main script. Module not found error: no module named pygments.lexers.python

I am trying to create a file .exe from a .py file with cx_Freeze. I had successifully build the setup file but when I run the .exe file, it returns me this error: -I tried to install again Python -I tried to update pygments but it says that the…
Peppe
  • 3
  • 3
0
votes
1 answer

How can I change background of the specific lines in Pygments?

I developed a code to show the coverage for specific C, C++ and Python files (Coverage is computed b using GCov). Now I can show the source code using Pygments. I have an array of covered lines and missed lines, I want to change the background of…
Iman
  • 473
  • 1
  • 4
  • 20
0
votes
1 answer

Font not found with Pygments' ImageFormatter

I'm trying Pygments to convert some code into a highlighted image. Here's the Python script: from pygments.lexers import PhpLexer from pygments.formatters import ImageFormatter from pygments.filters import CodeTagFilter from pygments import…
Lucien S.
  • 5,123
  • 10
  • 52
  • 88
0
votes
1 answer

I can not get pigments highlighting for Python to work in my Sphinx documentation

I've tried adding highlight_language and pygments_style in the config.py and also tried various ways I found online inside the .rst file. Can anyone offer any advice on how to get the syntax highlighting working?
Ben Dent
  • 37
  • 1
  • 7
0
votes
0 answers

Get css for highlighted code with markdown from code without using a command

I was able to convert markdown to html with code highlighting using python markdown library with the following code: md = Markdown( extensions=[ FencedCodeExtension(), 'fenced_code', …
Chen Guevara
  • 324
  • 1
  • 4
  • 14
0
votes
2 answers

convert html to docx without losing styles

I'm trying to convert html file to docx I tried pandoc but it seems that it can't add styles so are there any way to convert it to docx with the styles? edit: I used pygments to highlight some code and wants to get it in docx file but it seems that…
0
votes
0 answers

Message "you must have pygmentize installed to use this package" while Pygments is already installed

I'm try to use the minted package in latex to display code in latex document. From Texstudio, I get an error message "you must have pygmentize installed to use this package". However, if I type pip3 install pygments I get Requirement already…
ecjb
  • 5,169
  • 12
  • 43
  • 79
0
votes
2 answers

How to configure Jekyll Syntax Highlight?

By configure I mean font size, font family, syntax highlight style, line numbers and so on. I have followed some tutorials but they don't worked for me. What I did: added markdown: kramdown and highlighter: rouge to _config.yml; added a css theme…
tomrlh
  • 1,006
  • 1
  • 18
  • 39