Re: [NTG-context] Listings (was: Experience on writing a thesis with MKIV)

2008-10-02 Thread Chen Shen
Hi all,

Here is a simplistic C syntax highlighter. I hope I've extracted
comments/strings/numerics (more or less) correctly.

shenchen


On Wed, Oct 1, 2008 at 11:44 AM, Chen Shen [EMAIL PROTECTED] wrote:
 Hi,

 Thanks for the pointers. It seems that the syntax-highlighter only
 need supply function buffers.visualizers.mp.flush_line_(), which
 returns a buffer containing the typesetting commands. Will try playing
 with it.

 At the moment, I am looking for the feature with
 \setuptyping[option=commands]. I saw \mksetupcommandsintype defined,
 and buffers.visualizers.enableescape = true set in core-ver.mkiv,
 but it isn't handled in the default visualizer.

 ---
 \starttext
 \setuptyping[option=commands]
 \starttyping
 abc abc /sl abc /BTEX{\sl abc}/ETEX
 \stoptyping
 \stoptext
 ---

 regards,
 shenchen

 On Wed, Oct 1, 2008 at 1:15 AM, Wolfgang Schuster
 [EMAIL PROTECTED] wrote:

 Am 30.09.2008 um 18:37 schrieb Chen Shen:

 Hi Wolfgang,

 I guess you are referring to mkii features. It seems that formatting
 in verbatim doesn't work in mkiv yet, or did I miss out something?
 None of the wiki verbatim examples worked for me.

 Syntax hyghlighting is implemented in different ways for MkII
 and MkIV, MkII use TeX code while MkIV use Lua code to show
 the keywords etc.

 Hans added only files for TeX, MetaPost and Lua in MkIV but
 you could write files for more languages, you find the rules in
 the verb-*.lua files.

 Regards,
 Wolfgang

 ___
 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
 ___




verb-cpp.lua
Description: Binary data


t1.tex
Description: TeX document
___
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
___


Re: [NTG-context] Listings (was: Experience on writing a thesis with MKIV)

2008-09-30 Thread Chen Shen
Hi Wolfgang,

I guess you are referring to mkii features. It seems that formatting
in verbatim doesn't work in mkiv yet, or did I miss out something?
None of the wiki verbatim examples worked for me.

regards,
shenchen

On Mon, Sep 29, 2008 at 2:16 AM, Wolfgang Schuster
[EMAIL PROTECTED] wrote:

 \setupcolors[state=start]

 \definetyping[JAVA][option=JV]

 \setuptyping
   [JAVA]
   [numbering=line]

 \starttext

 \startJAVA
 ...
 \stopJAVA

 \stoptext

 or

 same preamble as above plus

 \definefloat[listing][listings]

 \starttext

 \placelisting
[split]
[lst:freeformlogfile]
{Log File}
{\startJAVA
 ...
 \stopJAVA}

 \stoptext

 Wolfgang

 __
___
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
___


Re: [NTG-context] Listings (was: Experience on writing a thesis with MKIV)

2008-09-30 Thread Wolfgang Schuster

Am 30.09.2008 um 18:37 schrieb Chen Shen:

 Hi Wolfgang,

 I guess you are referring to mkii features. It seems that formatting
 in verbatim doesn't work in mkiv yet, or did I miss out something?
 None of the wiki verbatim examples worked for me.

Syntax hyghlighting is implemented in different ways for MkII
and MkIV, MkII use TeX code while MkIV use Lua code to show
the keywords etc.

Hans added only files for TeX, MetaPost and Lua in MkIV but
you could write files for more languages, you find the rules in
the verb-*.lua files.

Regards,
Wolfgang

___
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
___


Re: [NTG-context] Listings (was: Experience on writing a thesis with MKIV)

2008-09-30 Thread Chen Shen
Hi,

Thanks for the pointers. It seems that the syntax-highlighter only
need supply function buffers.visualizers.mp.flush_line_(), which
returns a buffer containing the typesetting commands. Will try playing
with it.

At the moment, I am looking for the feature with
\setuptyping[option=commands]. I saw \mksetupcommandsintype defined,
and buffers.visualizers.enableescape = true set in core-ver.mkiv,
but it isn't handled in the default visualizer.

---
\starttext
\setuptyping[option=commands]
\starttyping
abc abc /sl abc /BTEX{\sl abc}/ETEX
\stoptyping
\stoptext
---

regards,
shenchen

On Wed, Oct 1, 2008 at 1:15 AM, Wolfgang Schuster
[EMAIL PROTECTED] wrote:

 Am 30.09.2008 um 18:37 schrieb Chen Shen:

 Hi Wolfgang,

 I guess you are referring to mkii features. It seems that formatting
 in verbatim doesn't work in mkiv yet, or did I miss out something?
 None of the wiki verbatim examples worked for me.

 Syntax hyghlighting is implemented in different ways for MkII
 and MkIV, MkII use TeX code while MkIV use Lua code to show
 the keywords etc.

 Hans added only files for TeX, MetaPost and Lua in MkIV but
 you could write files for more languages, you find the rules in
 the verb-*.lua files.

 Regards,
 Wolfgang

 ___
 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
 ___

___
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
___