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
8
votes
3 answers

Python Markdown - Not adding codehilite

I am using Flask to write a Blog, with that I am using Markdown's Python library to generate HTML for me, I am willing to have syntax highlighting, therefore I am using markdown.markdown(string, extensions=['codehilite'] According to their wiki, it…
user689383
7
votes
1 answer

How to add ipython syntax highlighting to pygmentize?

I need syntax highlighting in a latex project, using the minted package I can use the pygments lexers, there is a lexer for ipython here. How can I add this to pygments ?? (windows or OSX)
canesin
  • 1,967
  • 2
  • 18
  • 30
7
votes
2 answers

Jekyll is ignoring Liquid tags within posts

I'm new to Jekyll, Liquid and Ruby as a whole, so sorry if I'm being really stupid. It seems that Jekyll is ignoring any liquid tags with posts (under the _posts directory), which results in output like the following. These posts are all formatted…
Nate Higgins
  • 2,104
  • 16
  • 21
6
votes
1 answer

generating a custom Styling for python pygments

I am currently using python pygments for my website to highlight some code and would like to adjust some of the colors used. So far I have tried the following approach: from pygments.token import Keyword, Name, Comment, String, Error, \ Number,…
Yes
  • 339
  • 3
  • 19
6
votes
1 answer

Is there a way to highlight function calls using Pygments (or another library)?

I was quite disappointed to discover that functions calls were not highlighted using Pygments. See it online (I tested it with all available styles) Builtin functions are highlighted but not mine. I looked at the tokens list but there is no…
Delgan
  • 18,571
  • 11
  • 90
  • 141
6
votes
1 answer

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} \include{someCode.hs} some…
fuz
  • 88,405
  • 25
  • 200
  • 352
6
votes
3 answers

Getting Pygments to work for my cell results

I use Jupyter Notebooks to implement and document changes that apply to our production databases. I program in Python and submit typical SQL statements to the server to fetch results and make changes. I like to print the sql as part of the cell…
user2315423
  • 609
  • 1
  • 6
  • 17
6
votes
2 answers

How to find list comprehension in python code

I want to find a list comprehension in python source code, for that I tried to use Pygments, but it didn't find the way to do that. To be more specific, I want to do a function that recognize all the posible list comprehension. For example: [x**2…
merpi
  • 73
  • 3
6
votes
1 answer

How do I make lines of code wrap in Jekyll?

By default all the lines scroll if wider than the box, but I'd like them to wrap. How do I accomplish this?
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
6
votes
1 answer

source code syntax highlighting for trac?

I've installed trac on my Ubuntu server but there is no php syntax highlighting. I have installed Pygments using apt-get install but how do I configure trac so it uses highlighting in the svn source browser?
never_had_a_name
  • 90,630
  • 105
  • 267
  • 383
6
votes
1 answer

Why does Pygment.rb not highlight tags within
 properly -i.e. Google Prettify friendly tags?

I am calling it in my view like this: <%= markdown question.body %> This is what my ApplicationHelper looks like: module ApplicationHelper class HTMLwithPygments < Redcarpet::Render::HTML def block_code(code, language) …
marcamillion
  • 32,933
  • 55
  • 189
  • 380
6
votes
5 answers

Utilizing emacs' or vim's syntax highlighter for command-line program?

I have a command-line program that spews JSON and YAML. By default it detects if pygments (pygmentize) is available and if it does, pass the output throught it to get a nice colorized output. However, pygments is not installed by default on most…
Steven Haryanto
  • 741
  • 5
  • 13
6
votes
1 answer

Sphinx Pygments lexer filter extension?

I have a Lisp-like language I would like to highlight using Pygments in Sphinx code snippet documentation. My approach is to extend the existing CommonLispLexer to add the built-in names using a NameHighlightFilter. However, it is not working, so…
5
votes
1 answer

I get an ImportError: cannot import name bytes with pygments

I wanted to get syntax highlighting for code plugin (https://ankiweb.net/shared/info/491274358) in Anki (https://ankiweb.net/) to be able to highlight ipython synthax. I installed pygments-ipython-console from here:…
chriad
  • 1,392
  • 15
  • 22
5
votes
0 answers

Potentially devious behaviour of pygments´ mapping.py / Editing a pygments lexer

I'm using Windows 7, latest windows update etc. Recently I decided to start using the minted package in LaTeX. For this, I was redirected to install pygments, which I installed through pip: I'll run you through quickly what I did (to make sure I…
Euryris
  • 250
  • 2
  • 10
1 2
3
17 18