A module for generic external syntax highlighter
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
participants (1)
-
Aditya Mahajan