ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* A module for generic external syntax highlighter
@ 2011-05-18  1:54 Aditya Mahajan
  0 siblings, 0 replies; only message in thread
From: Aditya Mahajan @ 2011-05-18  1:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-18  1:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18  1:54 A module for generic external syntax highlighter Aditya Mahajan

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).