ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: A module for generic external syntax highlighter
Date: Tue, 17 May 2011 21:54:18 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LNX.2.01.1105121649370.4573@ybpnyubfg.ybpnyqbznva> (raw)

Hi all,

I have modularized the vim module[1] so that it is easy to reuse 
components for other external syntax highlight programs. The set up for 
defining a new external syntax highlighting is done in t-syntax-highlight 
module, and the set up for defining a new color scheme is done in 
t-syntax-groups. The vim module simply calls these modules with the 
relevant setups.

These modules also use an experimental coding style for the ConTeXt code. 
This is based on some discussions that we had on the list earlier. (This 
style sets the catcode of : to be other; this can break existing ConTeXt 
code). All modules work with both MkII and MkIV; as a result, some of the 
things are more complicated than they need to be just for MkIV.

I believe that this split will make it easy to add new external programs 
as syntax highlighters. The external highlighter needs to generate ConTeXt 
code in a specific format:

- Start each new line with \CR{}
- Escape all \, {, and }, as \\, \{, and \}
- Group each syntax region as follows:

       \SYN[group-name]{content}

The external highlighter should also support a means of specifing the 
start and stop lines to be highlighted.

At the TeX end, a new syntax highlighting module should specify the exact 
external command to be called, and define color schemes (style and color) 
for each of the group-name used in the \SYN command in the highlighter.

In case anyone is interested in testing a specific external highlighter, 
let me know. Any other feedback is welcome.

Aditya

[1]: https://github.com/adityam/filter/tree/dev
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


                 reply	other threads:[~2011-05-18  1:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=alpine.LNX.2.01.1105121649370.4573@ybpnyubfg.ybpnyqbznva \
    --to=adityam@umich.edu \
    --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).