[NTG-context] Files for verbatim output of Python source, zc.buildout and Apache config files
Hello, I'm using MKIV and needed syntax highlighting for a few source and config files. I read on the Wiki and on this list that it should be pretty easy to do this in Lua and although I never wrote anything in Lua I just tried it. Maybe the result will be of use for somebody so I tried to post them to this list a few days ago but the mail never showed up. Maybe because of the attachment size. I read on the Wiki that the best place for putting custom formatter files would be the context distribution or http://modules.contextgarden.net but as I'm pretty sure that some stuff is missing and I'm sure there are some bugs included I tried to post them here. Would it be OK to put the files in a section on the Wiki to start something like a repository for verb-*.lua files where it would be easy to extend and correct them? The verb-*.lua files I created are for syntax highlighting of Python source code, Apache http.conf and zc.buildout config files. For the zc.buildout files I used a simple solution and just defined the keywords that appear in a standard Plone buildout.cfg file as I didn't need more. I hope to finish two additional verbatim files for XML and Shell scripts in the next days. As I don't have any experience in writing Lua code I chose to use the tex/context/base/verb-*.lua and the verb-cpp.lua files posted by Shen Chen in http://archive.contextgarden.net/message/20081002.173802.460c46fe.en.html) for a start. Additionally I used the vim syntax files and the official Apache documentation. Here is an overview of what is covered: The verb-apa.lua file distinguishes between the following five states: - declarations - strings - sections (like Directory and /Directory) - comments - options The verb-py.lua file distinguishes between the following five states: - all statements, repeats, conditionals and operators - strings (multi line comment wit ''' or are supported) - preconditions (import, from, as) - comments - builtins The verb-py.cfg file distinguishes between the following four states: - sections - variables - keywords - comments Regards, Drazen ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Files for verbatim output of Python source, zc.buildout and Apache config files
Drazen Baic wrote: Would it be OK to put the files in a section on the Wiki to start something like a repository for verb-*.lua files where it would be easy to extend and correct them? sure, just go ahead - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Files for verbatim output of Python source, zc.buildout and Apache config files
On Sun, Apr 19, 2009 at 7:09 PM, Hans Hagen pra...@wxs.nl wrote: Drazen Baic wrote: Would it be OK to put the files in a section on the Wiki to start something like a repository for verb-*.lua files where it would be easy to extend and correct them? sure, just go ahead - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - thanks. I have created a page under http://wiki.contextgarden.net/Verbatim_with_LuaTeX ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Files for verbatim output of Python source, zc.buildout and Apache config files
Hello, I'm using MKIV and needed syntax highlighting for a few source and config files. I read on the Wiki and on this list that it should be pretty easy to do this in Lua and although I never wrote anything in Lua I just tried it. Maybe the result will be of use for somebody so I'm posting them to this list. I read on the Wiki that the best place for putting custom formatter files would be the context distribution or http://modules.contextgarden.net but as I'm pretty sure that some stuff is missing and I'm sure there are some bugs included I'm just posting them here. Would it be OK to put the files in a section on the Wiki to start something like a repository for verb-*.lua files where it would be easy to extend and correct them? I have created verb-*.lua files for pretty printing Python source code Apache http.conf and zc.buildout config files. For the zc.buildout files I used a simple solution and just defined the keywords that appear in a standard Plone buildout.cfg file. I hope to finish two additional verbatim files for XML and Shell scripts in the next days. As I don't have any experience in writing Lua code I chose to use the tex/context/base/verb-*.lua and the verb-cpp.lua files posted by Shen Chen in http://archive.contextgarden.net/message/20081002.173802.460c46fe.en.html) for a start. Additionally I used the vim syntax files and the official Apache documentation. Here is an overview of what is covered: The verb-apa.lua file distinguishes between the following five states: - declarations - strings - sections (like Directory and /Directory) - comments - options The verb-py.lua file distinguishes between the following five states: - all statements, repeats, conditionals and operators - strings (multi line comment wit ''' or are supported) - preconditions (import, from, as) - comments - builtins The verb-py.cfg file distinguishes between the following four states: - sections - variables - keywords - comments I've attached a minimal test file to show how they work. Just put everything in one directory and execute texexec --lua test.tex Regards, Drazen test.tex Description: TeX document verb-apa.lua Description: Binary data verb-cfg.lua Description: Binary data verb-py.lua Description: Binary data ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___