How to create Pygments extension for Sphinx

G

Glenn Hutchings

Hi there Pythonistas...

I'm writing documentation for a non-Python program using Sphinx
(http://sphinx.pocoo.org), which is great. The program has an input
file syntax suitable for highlighting using Pygments (http://
pygments.org), but, obviously, Pygments knows nothing about it. I've
created a Pygments lexer which should highlight things, but how do I
tell Pygments about the new lexer, short of manually adding the Python
source to the Pygments "lexers" directory (clearly the Wrong Thing)?

I've scoured Sphinx, Pygments and setuptools documentation, and
seemingly the only way is to register a setuptools 'entry point' in
the setup() function -- but that implies I'm installing a Python
package, which I'm not. Do I have to create one, or is there another
way?

Glenn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top