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

Jython - using Pygments in Java project

I'm trying to use Pygments in Java project by including Jython.jar. In my Java project I have src/main/python source directory where I placed pygments files into pygments folder so they end up on the classpath. Now I created highlighter.py file in…
Bostone
  • 36,858
  • 39
  • 167
  • 227
1
vote
1 answer

"RuntimeError: maximum recursion depth exceeded while calling a Python object" error in PyQt4 python

I am creating a simple text editor in PyQt4 through Pygments syntex highlighter. I have the following code. from PyQt4 import QtCore, QtGui import time,sys from PyQt4.QtGui import * from PyQt4.QtCore import * from pygments import highlight from…
Ahmad Taha
  • 1,975
  • 2
  • 17
  • 27
1
vote
1 answer

(Errno::EACCES) Permission denied with pygments.rb

I have been really struggling with installing pygments.rb and did not find solution whatsoever. This is the error code: PS C:\Users\PC\Desktop> gem install pygments.rb ERROR: While executing gem ... (Errno::EACCES) Permission denied @…
1
vote
1 answer

Should I use Pygments with a Scala App?

I am looking at building a Scala web app that will have lots of code snippets in many programming languages that I would like to hightlight. It looks like one of the best, most popular syntax highlighters is Pygments, a Python tool. I downloaded…
pr1001
  • 21,727
  • 17
  • 79
  • 125
1
vote
1 answer

using more than one highlight color in pygments

I'm using pygments to highlight lines from a file, but I want to highlight different lines with different colors. note While I was writing this question I tried different things until I found what looks like a decent solution that solves my problem.…
lorenzog
  • 3,483
  • 4
  • 29
  • 50
1
vote
1 answer

Stream a string into pygments lexer?

I'd like to use pygments to highlight code for me on the fly - basically a huge list of JSON objects. Here's what I tried: from pygments.lexers import JsonLexer from pygments.formatters import HtmlFormatter from pygments import highlight import…
d33tah
  • 10,999
  • 13
  • 68
  • 158
1
vote
1 answer

How to run minted package in TeXnicCenter using MiKTeX

I am working with LaTeX on Vista using TeXnicCenter 2.0 Alpha 3 (build 1118) having installed MiKTeX 2.8. I want to use code highlighting for Objective-C and read here that the minted package is great. I installed Python 2.7 and pygmentize as told…
JJD
  • 50,076
  • 60
  • 203
  • 339
1
vote
3 answers

change the priority of pythonpath

When I was loading certain modules [namely pygments.lexers Bash Lexer and pygments.formatters LatexFormatter] I was was getting an error that python couldn't find the modules. I then realised that this problem was being caused by my PYTHONPATH,…
sean read
  • 305
  • 3
  • 14
1
vote
1 answer

No module named Pygments

I have installed Pygments into my virtualenv, and it appears to be imported properly into my project. I'm using PyCharm, and I'm getting no import errors from the IDE. But when I try to run it on localhost, I get the following error: My…
123
  • 8,733
  • 14
  • 57
  • 99
1
vote
3 answers

markdown display incorrect when add code block in list

I am using pygments and kramdown in my jekyll blog. I tried to add code block to markdown list, but display incorrect. 1. first 2. second {% highlight ruby %} def foo puts 'foo' end {% endhighlight %} 3. third generated…
pangpang
  • 8,581
  • 11
  • 60
  • 96
1
vote
1 answer

CSS label line numbers without pre-splitting lines into divs/list (output of Jekyll + Redcarpet + Pygments)

There's a lot of results on Google for CSS-based line numbering for code samples. Unfortunately, it seems all of them assume that you have your individual lines of code in separate divs or lis. Is there an alternative technique for the case where…
Ming
  • 1,613
  • 12
  • 27
1
vote
3 answers

Using Pygments with PHP (Python in PHP)

Is it possible to use Python (specifically Pygments) with PHP? Currently, I have a phpBB forum that I'm developing for and JS Syntax Highlighters just haven't been working for me. There's already a GeSHI mod, but I want to develop something myself…
Gio Borje
  • 20,314
  • 7
  • 36
  • 50
1
vote
1 answer

How do I get syntax highlighting when using HTML as source in Pelican?

I recently started using the pelican cms, and I prefer to write my articles in HTML, as opposed to rst or markdown. Thats's fine. Pelican lets me do that. But I can't seem to find any way to specify the language for
 blocks so Pelican will run…
elzapp
  • 1,961
  • 4
  • 15
  • 22
1
vote
1 answer

Printing colorful syntax highlighting to paper

I want to print out some code on paper including syntax highlighting. After some research, I found out, that I could do this with pygments and enscript, but don't know how to combine these tools. Obviously there must be someone out there, who has…
uloco
  • 2,283
  • 4
  • 22
  • 37
1
vote
0 answers

Redcarpet + Pygments - Multiline Error

I followed this Railscast to try to incorporate syntax highlighting and markdown in my Rails app: http://railscasts.com/episodes/207-syntax-highlighting-revised?view=asciicast But for some reason, it's only applying formatting to single line…
scientiffic
  • 9,045
  • 18
  • 76
  • 149