ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Drazen Baic <dpeterx@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Files for verbatim output of Python source, zc.buildout and Apache 	config files
Date: Sun, 19 Apr 2009 18:54:26 +0200	[thread overview]
Message-ID: <6607a2f30904190954mfc9fd86h7b0dbd4fdc839855@mail.gmail.com> (raw)

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
___________________________________________________________________________________


             reply	other threads:[~2009-04-19 16:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-19 16:54 Drazen Baic [this message]
2009-04-19 17:09 ` Hans Hagen
2009-04-19 20:23   ` Drazen Baic
  -- strict thread matches above, loose matches on Subject: below --
2009-04-16 20:35 Drazen Baic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6607a2f30904190954mfc9fd86h7b0dbd4fdc839855@mail.gmail.com \
    --to=dpeterx@googlemail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).