pygments

How can I customize the output from pygments?

If I run a python source file through pygments, it outputs html code whose elements class belong to some CSS file pygments is using. Could the style attributes be included in the outputted html so that I don't have to provide a CSS file? ...

Sensible python source line wrapping for printout

I am working on a latex document that will require typesetting significant amounts of python source code. I'm using pygments (the python module, not the online demo) to encapsulate this python in latex, which works well except in the case of long individual lines - which simply continue off the page. I could manually wrap these lines exc...

Syntax highlighting with Markdown & Pygments in Django

I've been trying to get syntax highlighting working in my simple Django (1.1) test app using Markdown (2.0.1) & Pygments (1.0). The idea is to generate HTML from the users input which is in markdown format and store both in the DB so I don't have to do the markdown to html translation during the fetch. So far I have the markdown proce...

Python library for syntax highlighting

Which Python library for syntax highlighting is the best one? I'm interested in things like supported languages, ease of use, pythonic design, dependencies, development status, etc. ...

Django syntax highlighting causing character escaping issues

I've been working on my own django based blog (like everyone, I know) to sharpen up my python, and I thought added some syntax highlight would be pretty great. I looked at some of the snippets out there and decided to combine a few and write my own syntax highlighting template filter using Beautiful Soup and Pygments. It looks like this:...

Integrate Syntax Highlighter (Prettify, Pygments,..) with Plone

I'm actually challenged with documenting aspects/problems/usages of inherited source code to teach and train co-workers as well as to identify problems that should be future maintenance tasks... The idea is to create an internal wiki or blog with short articles that highlight certain features and provide hints for using the API. We alre...

Texments package not working on Ubuntu

I am trying to use the Texments Latex package on Ubuntu to do syntax highlighting. Texments is a wrapper around Pygments. I installed Texments and followed the steps to add the style file to the path. But when I try to compile the .tex file, I get the error. !Undefined Control Sequence and then it prints out a bunch of wierd characters...

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 (for an own language definition) to define (and highlight!) own number styles. listings d...

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' breaklines=true in the past, but I don't see a way to get that functionality using the Mi...

How to reduce the seperation from other text using LaTeX minted?

I want to use the minted package to give me syntax highlighting but it has a spacing of more than a centimeter. Setting: \setlength{\parskip}{0pt} \setlength{\parsep}{0pt} \setlength{\headsep}{0pt} \setlength{\topskip}{0pt} \setlength{\topmargin}{0pt} \setlength{\topsep}{0pt} \setlength{\partopsep}{0pt} does not help at all. Is there...

Is there a way in Sphinx/Pygments to emphasize one or more lines of code in literal includes?

In some sphinx docs I am writing, I am including code samples from an ancillary file like so: .. literalinclude:: mymodule.py :pyobject: MyClass :linenos: This particular doc is a tutorial, where the classes are build up step by step. What I would like to do is include the entire class or a single method, and emphasize only the ...

source code syntax highlighting for trac?

i've intalled trac on my ubuntu server but there is no php syntax hightlighting. i have installed pygments using apt-get install but how do i configure trac so it uses hightlighting for svn browsing? ...

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 to lex anything... When is lexing enough, when do you need EBNF ? Has anyone used t...

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 just for experience. Also, would there be performance issues? ...

Pygments in wxPython?

Is it at all possible to use Pygments inside of wxPython to provide syntax highlighting? ...

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 in the minted documentation. I also set the compiler option -shell-escape in TeXnicCenter. ...

How to include a file in LaTeX wihout causing a newpage.

I hope, this question is not too offtopic. I have a bigger school project which involves some documentation. The documentation is a LaTeX file, and looks like this: ... some explanation \section {someCode} \inclue{someCode.hs} some explanation ... The files someCode.hs.tex are auto-genereated from their corresponding .hs-Files using...

Parsing a document with BeautifulSoup while not-parsing the contents of <code> tags

I'm writing a blog app with Django. I want to enable comment writers to use some tags (like <strong>, a, et cetera) but disable all others. In addition, I want to let them put code in <code> tags, and have pygments parse them. For example, someone might write this comment: I like this article, but the third code example <em>could have...

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 Jython and was able to load first it and then Pygments from within my Scala REPL. However, al...