A pygments lexer and style for mkgmap style files
pip install mkgmap-pygments==1.5
This package installs a new lexer for pygmentize to syntax highlight mkgmap style files. You can then use pygmentize (or the API) with the lexer 'mkgmap' to highlight style files.
To install from pypi with pip:
pip install mkgmap-pygments
You can also install from the source package in the usual ways.
python setup.py install
or with pip:
pip install .
All these installation methods will install pygmentize if it not already installed.
To just display a file to the terminal:
pygmentize -l mkgmap lines
To create a complete html file:
pygmentize -l mkgmap -f html -Ofull=true,style=mkgmap -o output.html lines
The example uses the style 'mkgmap' which is a style that is included in this package which is designed to distinguish the different elements clearly and is the style used in the mkgmap documentation and web site. You can use any of the other styles that are available in pygmentize according to taste. Some styles do not distinguish every different syntax context that is required. You can use the default style without any problems.
This syntax highlighter is fairly complete and it should help find problems in styles that are difficult to see otherwise. In particular it might help find problems that are valid syntax but not what you actually wanted. Of course it is useful for creating documentation too!
There are a number of tricky things about the style syntax. The following have been tested and work in at least one case.