ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Custom XML Pretty Printer
@ 2010-12-18 22:39 Renaud AUBIN
  2011-01-16 20:34 ` Renaud AUBIN
  0 siblings, 1 reply; 6+ messages in thread
From: Renaud AUBIN @ 2010-12-18 22:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi there,

See http://gitorious.org/xml-pretty-printer-module-for-context for testing.
As soon as I have made more testing and some improvements (inc. cleaning
up), I'll submit to tlcontrib.

Cheers,

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

* Re: Custom XML Pretty Printer
  2010-12-18 22:39 Custom XML Pretty Printer Renaud AUBIN
@ 2011-01-16 20:34 ` Renaud AUBIN
  2011-01-16 22:06   ` Aditya Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Renaud AUBIN @ 2011-01-16 20:34 UTC (permalink / raw)
  To: ntg-context

Now available on tlcontrib:
http://tlcontrib.metatex.org/cgi-bin/package.cgi/ruid=4591828845/action=view/id=388

Cheers,

Renaud

Le 18/12/2010 23:39, Renaud AUBIN a écrit :
> Hi there,
>
> See http://gitorious.org/xml-pretty-printer-module-for-context for testing.
> As soon as I have made more testing and some improvements (inc. cleaning
> up), I'll submit to tlcontrib.
>
> Cheers,
>
> Renaud
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

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

* Re: Custom XML Pretty Printer
  2011-01-16 20:34 ` Renaud AUBIN
@ 2011-01-16 22:06   ` Aditya Mahajan
  2011-01-17 19:42     ` Renaud AUBIN
  2011-01-18 21:46     ` Renaud AUBIN
  0 siblings, 2 replies; 6+ messages in thread
From: Aditya Mahajan @ 2011-01-16 22:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

On Sun, 16 Jan 2011, Renaud AUBIN wrote:

> Now available on tlcontrib:
> http://tlcontrib.metatex.org/cgi-bin/package.cgi/ruid=4591828845/action=view/id=388

Any particular reasons why the spaces are not part of the syntax 
highlighting group? For example just add

\def\RaXmlSnippetComment#1{«#1»}

and observe the output:

«<!--» «T»«h»«a»«t» «i»«s» «a» «t»«e»«s»«t» «-->»

I want to use a different syntax highlighting scheme that provides 
background colors and such. For that, it will be much nicer if the output 
were

«<!-- That is a test -->»

Is that possible?

Aditya

[-- Attachment #2: Type: text/plain, Size: 486 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] 6+ messages in thread

* Re: Custom XML Pretty Printer
  2011-01-16 22:06   ` Aditya Mahajan
@ 2011-01-17 19:42     ` Renaud AUBIN
  2011-01-18 21:46     ` Renaud AUBIN
  1 sibling, 0 replies; 6+ messages in thread
From: Renaud AUBIN @ 2011-01-17 19:42 UTC (permalink / raw)
  To: ntg-context, Hans Hagen

Hi Aditya and happy ConTeXters,

I've worked at the beginning to include those spaces in the different
syntax highlighting groups but failed. Considering the definition of
Comment in the grammar provided by t-pretty-ra-xml.lua:

−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
we have the following lua code:
Comment =
    makepattern(handler,"comment", Comment_open) *
    (
        V("line") +
        V("whitespace") +
        makepattern(handler, "comment", Comment_content)
    )^0 *
    makepattern(handler,"comment", Comment_close),

Here I use the fallback mechanism to the default grammar, defined in
v-default.lua, with V("line") and V("whitespace").

−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
To circumvent the problem described by Aditya, I assumed that I could do
(since I cannot remember my first experiments, ante git versioning):

local line =  patterns.newline * (patterns.emptyline)^0 * patterns.beginline
local whitespace = (patterns.space + line)^1
[…]
Comment =
    makepattern(handler,"comment", Comment_open) *
    (
        makepattern(handler, "comment", line + whitespace +
Comment_content)
    )^0 *
    makepattern(handler,"comment", Comment_close),

The newlines are no more detected… I've tried some other code but
everything failed…

I don't know if this is related but, as you have probably noticed, I
don't manage multiple empty lines too.

I'm out of ideas, good as bad…


Hans, or another Guru, to the rescue? More than a solution for Aditya,
it would be nice to give me some line/space stuffs' tricks since the
resulting code could be cleaner and leaner too…

Cheers,

Renaud

Le 16/01/2011 23:06, Aditya Mahajan a écrit :
> On Sun, 16 Jan 2011, Renaud AUBIN wrote:
>
>> Now available on tlcontrib:
>> http://tlcontrib.metatex.org/cgi-bin/package.cgi/ruid=4591828845/action=view/id=388
>>
>
> Any particular reasons why the spaces are not part of the syntax
> highlighting group? For example just add
>
> \def\RaXmlSnippetComment#1{«#1»}
>
> and observe the output:
>
> «<!--» «T»«h»«a»«t» «i»«s» «a» «t»«e»«s»«t» «-->»
>
> I want to use a different syntax highlighting scheme that provides
> background colors and such. For that, it will be much nicer if the
> output were
>
> «<!-- That is a test -->»
>
> Is that possible?
>
> Aditya
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

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

* Re: Custom XML Pretty Printer
  2011-01-16 22:06   ` Aditya Mahajan
  2011-01-17 19:42     ` Renaud AUBIN
@ 2011-01-18 21:46     ` Renaud AUBIN
  2011-01-18 23:11       ` Aditya Mahajan
  1 sibling, 1 reply; 6+ messages in thread
From: Renaud AUBIN @ 2011-01-18 21:46 UTC (permalink / raw)
  To: ntg-context

Hi Aditya,

I'm working on that…
When do you need it?

Cheers,
Renaud

Le 16/01/2011 23:06, Aditya Mahajan a écrit :
> On Sun, 16 Jan 2011, Renaud AUBIN wrote:
>
>> Now available on tlcontrib:
>> http://tlcontrib.metatex.org/cgi-bin/package.cgi/ruid=4591828845/action=view/id=388
>>
>
> Any particular reasons why the spaces are not part of the syntax
> highlighting group? For example just add
>
> \def\RaXmlSnippetComment#1{«#1»}
>
> and observe the output:
>
> «<!--» «T»«h»«a»«t» «i»«s» «a» «t»«e»«s»«t» «-->»
>
> I want to use a different syntax highlighting scheme that provides
> background colors and such. For that, it will be much nicer if the
> output were
>
> «<!-- That is a test -->»
>
> Is that possible?
>
> Aditya
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

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

* Re: Custom XML Pretty Printer
  2011-01-18 21:46     ` Renaud AUBIN
@ 2011-01-18 23:11       ` Aditya Mahajan
  0 siblings, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2011-01-18 23:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

On Tue, 18 Jan 2011, Renaud AUBIN wrote:

> Hi Aditya,
>
> I'm working on that…

Thank you.

> When do you need it?

Well... it is not urgent for me ... t-vim is slow but it works fine :)

I was planning on a more advanced syntax highlighting module that will 
allow one to use different external highlighters: editors like vim, scite, 
etc., programs like syntax-color, pgyments, HsColor, etc, or even web 
services like hpaste.org or gist. At this time, all this at a dreaming 
stage, and I think that it will nice to be able to change the parser 
without changing the color scheme (and hence the request for group each 
code region in one command which will allow for a module to specify the 
unified color schemes)


Aditya

[-- Attachment #2: Type: text/plain, Size: 486 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] 6+ messages in thread

end of thread, other threads:[~2011-01-18 23:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-18 22:39 Custom XML Pretty Printer Renaud AUBIN
2011-01-16 20:34 ` Renaud AUBIN
2011-01-16 22:06   ` Aditya Mahajan
2011-01-17 19:42     ` Renaud AUBIN
2011-01-18 21:46     ` Renaud AUBIN
2011-01-18 23:11       ` 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).