https://github.com/gniezen/n3pygments
Pygments lexer to perform syntax highlighting for N3, Turtle and SPARQL
https://github.com/gniezen/n3pygments
Last synced: 5 months ago
JSON representation
Pygments lexer to perform syntax highlighting for N3, Turtle and SPARQL
- Host: GitHub
- URL: https://github.com/gniezen/n3pygments
- Owner: gniezen
- License: bsd-2-clause
- Created: 2012-01-23T13:54:28.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2015-04-15T14:08:22.000Z (over 10 years ago)
- Last Synced: 2024-05-14T15:32:10.861Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 198 KB
- Stars: 23
- Watchers: 5
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-semantic-web - n3pygments - Pygments lexer to perform syntax highlighting for N3, Turtle and SPARQL. (Tools / BBedit)
- awesome-semantic-web - n3pygments - Pygments lexer to perform syntax highlighting for N3, Turtle and SPARQL. (Misc / BBedit)
README
==========
n3pygments
==========
This is a [Pygments](http://http://pygments.org/) lexer that performs syntax highlighting for:
* n3, turtle : Turtle/N3/NT (*.ttl, *.n3 and *.NT)
* sparql : SPARQL (*.sparql)
Make sure you're running Pygments 1.7 or higher and run
sudo python setup.py install
to install and e.g.
pygmentize -l turtle filename.ttl
to run Pygments.
This is mostly code from [Openvest](http://www.openvest.com/trac/wiki/n3SyntaxHighlighting#Pygments) which seems to be abandoned. The original instructions on that site only works when using `pygmentize` from the command-line. This implementation registers the package as a proper Pygments plugin which you can use from within Python, e.g.:
from pygments.lexers import (get_lexer_by_name,get_lexer_for_filename)
get_lexer_by_name("turtle")
should return ``.
n3pygments was created based on [this answer](http://tex.stackexchange.com/a/14929/8419) on the TeX StackExchange site. So yes, you can use it to perform using syntax highlighting on your code in LaTeX using [Minted](http://code.google.com/p/minted/). I have also used it with success to perform syntax highlighting on an [Octopress 2.0](http://octopress.org) blog.
Thanks go out to [Raphaël Pinson](http://www.raphink.info) and [Philip Cooper](http://Openvest.com).