Re: [NTG-context] Syntax hightlighting

2019-08-28 Thread Hans Hagen

On 8/28/2019 8:14 PM, Fabrice L wrote:

Dear list,

I’m using colored verbatim code (for course notes). In the past, I 
modified verb-mp.mkii for the langage I need (SAS). This code works fine 
with MKII:


%——
\setupcolors[state=start]
\definetyping [MP] [option=MP]

\starttext
A example:
\startMP
draw (0,0) withpen pencircle 1in withcolor red ;
\stopMP
\stoptext
%——

I obtain a color syntax output (« draw » in red, « within » in green for 
example). This code does not work anymore in MKIV (every word is the 
same color, green). There should be a solution ?

Hard to say without your sas code as this just works:

\setupcolors[state=start]
\definetyping [MP] [option=MP]

\starttext

A example:

\startMP
draw (0,0) withpen pencircle 1in withcolor red ;
\stopMP

\usemodule[scite]

\startMP
draw (0,0) withpen pencircle 1in withcolor red ;
\stopMP

\stoptext

(I suppose that sas is abit like sql so pretty easy to write a lexer for 
it .. do you hav ean overview of the syntax that you use?)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Syntax hightlighting

2019-08-28 Thread Fabrice L
Dear list,

I’m using colored verbatim code (for course notes). In the past, I modified 
verb-mp.mkii for the langage I need (SAS). This code works fine with MKII:

%——
\setupcolors[state=start]
\definetyping [MP] [option=MP]

\starttext
A example:
\startMP
draw (0,0) withpen pencircle 1in withcolor red ;
\stopMP
\stoptext
%——

I obtain a color syntax output (« draw » in red, « within » in green for 
example). This code does not work anymore in MKIV (every word is the same 
color, green). There should be a solution ?

Trying to find some help, in the maling list and the « verbatim_text » page on 
Context garden, I found some solutions, like pretty printing, which should work 
on MKIV, but "pret-mp.lua » is found nowhere (nor in the context source 
browser, nor in my recent distribution). 

I must admit I’m lost in all the solutions I found there and there (most of 
them never works out of the box on my installation). Can somebody refer me to a 
simple solution, which permit me to do colored verbatim code, such as I can 
modify a source to insert the keywords of the langage I use ?

Thanks !
Fabrice.
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___