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
1
vote
1 answer

How to use `long` class names in Hugo/Pygments

I am using the pygmentsUseClasses=true setting on the Hugo Server but i'm receiving short class names like k for keyword. What i want; const What i have ; const What is missing?
1
vote
1 answer

KeyError: 'darkblue' when using trepan3k

I installed trepan3k with pip3 install trepan3k and I want to debug a file with trepan3k main.py, but I'm getting this error: Traceback (most recent call last): File "/usr/local/bin/trepan3k", line 10, in sys.exit(main()) File…
Nbfour
  • 145
  • 3
  • 10
1
vote
1 answer

Pygments to latex better formatting for py code

I am trying to include python code in my lyx document by inserting a file. I began by trying to use listings but this was causing code to overflow pages. Now I'm using pygments setting it up as described in this tutorial,…
wookie1
  • 511
  • 6
  • 18
1
vote
2 answers

Highlight source code of inspected functions in Juptyer lab/notebook

I have been using the following function to inspect function source code while working with Jupyter lab/notebook: def source(function): print(inspect.getsource(function)) For shorter codes this is fine, but at some point code highlighting would…
Konsta
  • 347
  • 4
  • 18
1
vote
1 answer

Doxygen->Sphinx->Pygments code-blocks lexer choice?

Esteemed colleagues! We've a large C++ project, with documentation created with Doxygen->Sphinx->Pygments. 99% of it works great, since we're documenting C++ code in *.cc files. However, there are some *.cc files that attempt to create code-blocks…
1
vote
1 answer

analyse_text() function of the Java Lexer in Pygments

I have written the following code using pygments to get info on a string: from pygments.lexers.jvm import JavaLexer import pygments.lexers.jvm t = 'float s = 0.5; System.out.println("Hello World");' lexer = JavaLexer() lexer.analyse_text(t) I get…
1
vote
1 answer

special non-syntactic highlighting in Pygments

I am using Pygments as part of MarkDown, Python, and LaTeX (through minted). For these reasons, I cannot easily change to another tool and would like to find a solution in Pygments. What I want to achieve is to have "special highlighting" beyond…
kvaruni
  • 832
  • 1
  • 10
  • 20
1
vote
0 answers

Getting ValueError 'Parse error: saw instead of expected ' while trying out pygments

I am trying out pygments to generated formatted text for python code file. I am trying sample code available on reportlab site. I wish to use it to generate pdf files with code suitably highlighted. The code files are: PdfGenerator.py from fpdf…
MsA
  • 2,599
  • 3
  • 22
  • 47
1
vote
1 answer

Tkinter / Pygments: Strange results in highlighting

I try to highlight texts according to tokens. Tokens can be highlighted by the below codes but there are some unwanted results. Some examples: Suppose to, i typed: a = "a" Both a's are highlighted with the same color despite the first 'a' is…
dildeolupbiten
  • 1,314
  • 1
  • 15
  • 27
1
vote
2 answers

gtags produces empty GTAGS file with pygments

I am trying to run gtags on a python code base with a pygments plug-in parser, but the GTAGS file produced is empty and the GRTAGS references stuff like "str" which just seems wrong to me. Here are relevant parts of the .globalrc: default:\ …
MrMeeSeeks
  • 91
  • 8
1
vote
1 answer

Django/Textile/Pygments: " ' > being escaped

I have a blog written in django that I am attempting to add syntax highlighting to. The posts are written and stored in the database as textile markup. Here is how they are supposed to be rendered via template engine: {{…
Cole Gleason
  • 191
  • 4
  • 16
1
vote
1 answer

How do syntax highlighting tools implement automated testing?

How do syntax highlighting tools such as pygments and textmate bundle do automated testing?
ben-albrecht
  • 1,785
  • 10
  • 23
1
vote
0 answers

How to get pygmentize CLI to use the Python3 lexers?

I'm having a problem debugging and issue lexing of a language using Python3 and pygments. I had the setup working with Python2 but failing to combine it correctly for Python3. MY primary question is how do I get the CLI pygmentize to use the Python3…
edA-qa mort-ora-y
  • 30,295
  • 39
  • 137
  • 267
1
vote
0 answers

Something is breaking my package deployment

I use setuptools and a requirements file to satisfy dependencies for my open source module. Example setup.py: from setuptools import setup, find_packages from pip.req import parse_requirements # parse_requirements() returns generator of #…
Matt Joyce
  • 2,010
  • 2
  • 20
  • 31
1
vote
0 answers

Syntax highlight for Fenced Code Blocks in flatpages-flask

I am trying to use flask-flatpages to render my markdown post. Markdown extension is fenced_code_blocks, so I set FLATPAGES_MARKDOWN_EXTENSIONS = ['fenced_code'] for flatpages-flask. And also I want to highlight my code using pygments css. Create…
l0o0
  • 773
  • 1
  • 9
  • 26