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
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 -----------------------------------------------------------------
On Sun, Apr 19, 2009 at 7:09 PM, Hans Hagen
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
participants (2)
-
Drazen Baic
-
Hans Hagen