ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* where are the pret-xxxx.lua ?
@ 2015-07-17  7:27 Eric Détrez
       [not found] ` <55A8FBD9.5010906@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Détrez @ 2015-07-17  7:27 UTC (permalink / raw)
  To: ntg-context

I wish to print some highlighted source codes.
The Context garden says "There are already some formatters for several 
programming languages in the ConTeXt distribution".
I can see the verb-xxxx (for mkII) but no pret-xxx (for mkIV) in the 
base folder.
Is it possible to get syntax highlight in mkIV ?

-- 
Eric Détrez
Informatique
Lycée Faidherbe, Lille
http://eric-detrez.fr
___________________________________________________________________________________
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] 4+ messages in thread

* Re: where are the pret-xxxx.lua ?
       [not found] ` <55A8FBD9.5010906@gmail.com>
@ 2015-07-17 14:24   ` Eric Détrez
  2015-07-17 14:36     ` Wolfgang Schuster
  2015-07-17 15:59     ` Aditya Mahajan
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Détrez @ 2015-07-17 14:24 UTC (permalink / raw)
  To: ntg-context

Le 17-07-2015 14:58, Wolfgang Schuster a écrit :
>> Eric Détrez
>> 17. Juli 2015 09:27
>> I wish to print some highlighted source codes.
>> The Context garden says "There are already some formatters for
>> several programming languages in the ConTeXt distribution".
>> I can see the verb-xxxx (for mkII) but no pret-xxx (for mkIV) in the
>> base folder.
>> Is it possible to get syntax highlight in mkIV ?
>  You can enable syntax highlighting for TeX, Lua, XML and MetaPost
> with MkIV. To enable the option pass "option=...” to the
> \starttyping command or create your own environment with the
> \definetyping command.

OK
Thank you for the working example.
But my question asked where are the config files : I want to get a 
Python pretty-printing.
The module abr-01 seems the key but I couldn't find it.

It seems that the answer could be in the t-vim (third party) module.
It uses the syntax analysis from VIm (you have to install it :))

-- 
Eric Détrez
Informatique
Lycée Faidherbe, Lille
http://eric-detrez.fr
___________________________________________________________________________________
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] 4+ messages in thread

* Re: where are the pret-xxxx.lua ?
  2015-07-17 14:24   ` Eric Détrez
@ 2015-07-17 14:36     ` Wolfgang Schuster
  2015-07-17 15:59     ` Aditya Mahajan
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2015-07-17 14:36 UTC (permalink / raw)
  To: info; +Cc: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 664 bytes --]

> Eric Détrez <mailto:info@eric-detrez.fr>
> 17. Juli 2015 16:24
>
>
> OK
> Thank you for the working example.
> But my question asked where are the config files : I want to get a 
> Python pretty-printing.
> The module abr-01 seems the key but I couldn't find it.
The module “abr-01” defines only the XML and LUA logos which is used in 
\subject.

The code for the syntax highlighting is stored in the file 
“buff-imp-xx.mkiv” and “buff-imp-xx.lua”. The TeX file sets the colors 
for the keywords etc. in your code and loads the correspoding Lua file 
and the Lua file itself stores the rules for the syntax highlighting.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1656 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 4+ messages in thread

* Re: where are the pret-xxxx.lua ?
  2015-07-17 14:24   ` Eric Détrez
  2015-07-17 14:36     ` Wolfgang Schuster
@ 2015-07-17 15:59     ` Aditya Mahajan
  1 sibling, 0 replies; 4+ messages in thread
From: Aditya Mahajan @ 2015-07-17 15:59 UTC (permalink / raw)
  To: info, mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 446 bytes --]

On Fri, 17 Jul 2015, Eric Détrez wrote:
> It seems that the answer could be in the t-vim (third party) module.
> It uses the syntax analysis from VIm (you have to install it :))

Here is a minimal example on how to use t-vim:

\definevimtyping [PYTHON]  [syntax=python]

\starttext

\startPYTHON
print("Hello")
\stopPYTHON

\stoptext

For more details, see: 
https://github.com/adityam/filter/blob/master/vim-README.md

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2015-07-17 15:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-17  7:27 where are the pret-xxxx.lua ? Eric Détrez
     [not found] ` <55A8FBD9.5010906@gmail.com>
2015-07-17 14:24   ` Eric Détrez
2015-07-17 14:36     ` Wolfgang Schuster
2015-07-17 15:59     ` 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).