Re: [code][textadept] Advanced use of Textadept Lexers

From: Mitchell <>
Date: Wed, 26 Feb 2014 22:55:32 -0500 (EST)

Hi Richard,

On Wed, 26 Feb 2014, Richard Philips wrote:

> Hi,
> last week I implemented HTML-ization of source code in textadept.
> For documentation purposes, I needed to capture code fragments together
> with its colorization and to format it in HTML.
> I took a short-cut :-)
> Together with the new multiple field ui.dialogs.inputbox (thanks again,
> Mitchell :-),
> I brought the relevant code fragments and formatting info
> outside textadept and worked with the phenomenal Pygments software.
> Then I brought the result (HTML) back into textadept and put the HTML in
> the clipboard.
> But I think I can do better:
> I looked into the code of lexer.load and lexer.lex and I think
> it should be possible to populate M._tokenstyles with functions instead of
> styles.
> These functions could transform the tokens to text (e.g. HTML).
> Is this something worthwhile to pursue? Any ideas about how to proceed?

I'm not sure I follow. Do you have an example that might help me
understand? What would an example transformation be?


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Wed 26 Feb 2014 - 22:55:32 EST

This archive was generated by hypermail 2.2.0 : Thu 27 Feb 2014 - 06:36:01 EST