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
360
votes
6 answers

lexers vs parsers

Are lexers and parsers really that different in theory? It seems fashionable to hate regular expressions: coding horror, another blog post. However, popular lexing based tools: pygments, geshi, or prettify, all use regular expressions. They seem…
Naveen
  • 5,910
  • 5
  • 30
  • 38
213
votes
3 answers

Source code highlighting in LaTeX

I need to highlight source code in LaTeX. The package listings seems to be the best choice for most use-cases and for me it was, until now. However, now I need more flexibility. Generally, what I’m looking for is a real lexer. In particular, I need…
Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
41
votes
10 answers

Jekyll on Windows: Pygments not working

I updated to the latest JekyllBuild (1.0.3) before I always used the RC. After updating the parsing of codes (with Pygments) doesn't work anymore. I always get the following…
Sebastian Sebald
  • 16,130
  • 5
  • 62
  • 66
40
votes
3 answers

Latex: Using Minted package - how do I make it wrap the text (linebreaks=true)

Im using the Pygments for a lot of things, and I'd like to also use this in my latex report. I found the package Minted which interacts with Pygments, but some of the comments and some of the code overflows the right margin. I have used lstlistings'…
Paddie
  • 611
  • 1
  • 8
  • 15
39
votes
3 answers

Jekyll serve didn't work: It looks like you don't have pygments or one of its dependencies installed

Configuration file: /Users/andrechristoga/Documents/type-theme/_config.yml Deprecation: You appear to have pagination turned on, but you haven't included the `jekyll-paginate` gem. Ensure you have `gems: [jekyll-paginate]` in your…
Andre Christoga
  • 497
  • 1
  • 5
  • 11
31
votes
4 answers

Github flavored Markdown and pygments highlighting in Jekyll

I've deployed my Jekyll blog on a VPS. I would now like to add Github-flavored Markdown to it, using Pygments highlighting, but I don't know which files do I have to edit and how. So far, the only file I've configured is _config.yml which looks like…
oFca
  • 2,830
  • 6
  • 31
  • 43
28
votes
2 answers

Highlight with Jekyll and pygments doesn't work

I want to use pygments with jekyll I have the following code: {% highlight java %} NullPointerException at org.springframework.core.GenericTypeResolver.getTypeVariableMap {% endhighlight %} When I generate my site with jekyll --pygments, the html…
denisjacquemin
  • 7,414
  • 10
  • 55
  • 72
26
votes
11 answers

Custom tag not loaded in template

I've created a custom tag that I want to use, but Django can't seem to find it. My templatetags directory is set up like this: pygmentize.py from pygments import highlight from pygments.lexers import get_lexer_by_name from django import…
123
  • 8,733
  • 14
  • 57
  • 99
24
votes
1 answer

How to support line number when using pygments with Jekyll

How can I number the code lines which are highlighted using pygments in Jekyll?
Usman Ismail
  • 17,999
  • 14
  • 83
  • 165
22
votes
3 answers

Sphinx: List of supported languages for highlighting?

I'm using Sphinx for code documentation and use several languages within the code, I would like to setup highlighting for all of that code. Sphinx briefly mentions a few of the languages it supports (on this page), and then mentions that it uses…
Nic Foster
  • 2,864
  • 1
  • 27
  • 45
21
votes
5 answers

Which Sphinx code-block language to use for JSON

I am using Sphinx to document a web service. I would like to show a formatted JSON web response using the code-block directive, which Spinx does via Pygments, but JSON doesn't have a syntax highlighter in Pygments. What language do you suggest I…
JayhawksFan93
  • 2,353
  • 3
  • 15
  • 11
21
votes
6 answers

Sphinx inline code highlight

I use Sphinx to make a website that contains code samples. I'm successful using the .. code-block directive to get syntax highlighting. But I can't get inline syntax highlighting using this code: .. role:: bash(code) :language: bash Test inline:…
user378147
18
votes
4 answers

How to support scrolling when using pygments with Jekyll

Is it possible to use horizontal scrolling rather than text wrapping in a code section highlughted with pygments when working in Jekyll. Source of document: {% highlight bash %} Full thread dump OpenJDK Client VM (19.0-b09 mixed mode,…
Usman Ismail
  • 17,999
  • 14
  • 83
  • 165
17
votes
3 answers

Syntax Highlighting with Pygments is failing via Liquid Templates String Error

I'm using Jekyll to convert my markdown and Pygments for syntax highlighting. Here is the error maruku displays: Liquid error: undefined method `join' for "\n song_info = []\n for song in songs:\n song_info.append(song.name) \n":String The markup…
muffs
  • 805
  • 10
  • 14
17
votes
1 answer

Change highlight colors in minted

I was setting up a nice environment to present my code in printed documentations. First I was using the lstlisting package for Latex but then I stumbled upon minted. minted is really great, but is there a way to change the highlight colors? Since…
Maaalte
  • 6,011
  • 3
  • 29
  • 27
1
2 3
17 18