Re: [NTG-context] where are the pret-xxxx.lua ?
Le 17-07-2015 14:58, Wolfgang Schuster a écrit :
Eric Détrez 17. Juli 2015 09:27 I wish to print some highlighted source codes. The Context garden says "There are already some formatters for several programming languages in the ConTeXt distribution". I can see the verb-xxxx (for mkII) but no pret-xxx (for mkIV) in the base folder. Is it possible to get syntax highlight in mkIV ? You can enable syntax highlighting for TeX, Lua, XML and MetaPost with MkIV. To enable the option pass "option=...” to the \starttyping command or create your own environment with the \definetyping command.
OK Thank you for the working example. But my question asked where are the config files : I want to get a Python pretty-printing. The module abr-01 seems the key but I couldn't find it. It seems that the answer could be in the t-vim (third party) module. It uses the syntax analysis from VIm (you have to install it :)) -- Eric Détrez Informatique Lycée Faidherbe, Lille http://eric-detrez.fr
Eric Détrez mailto:info@eric-detrez.fr 17. Juli 2015 16:24
OK Thank you for the working example. But my question asked where are the config files : I want to get a Python pretty-printing. The module abr-01 seems the key but I couldn't find it. The module “abr-01” defines only the XML and LUA logos which is used in \subject.
The code for the syntax highlighting is stored in the file “buff-imp-xx.mkiv” and “buff-imp-xx.lua”. The TeX file sets the colors for the keywords etc. in your code and loads the correspoding Lua file and the Lua file itself stores the rules for the syntax highlighting. Wolfgang
On Fri, 17 Jul 2015, Eric Détrez wrote:
It seems that the answer could be in the t-vim (third party) module. It uses the syntax analysis from VIm (you have to install it :))
Here is a minimal example on how to use t-vim: \definevimtyping [PYTHON] [syntax=python] \starttext \startPYTHON print("Hello") \stopPYTHON \stoptext For more details, see: https://github.com/adityam/filter/blob/master/vim-README.md Aditya
participants (3)
-
Aditya Mahajan
-
Eric Détrez
-
Wolfgang Schuster