From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/11028 Path: main.gmane.org!not-for-mail From: Guy Worthington Newsgroups: gmane.comp.tex.context Subject: Re: inlining pretty-printed XML Date: 14 Feb 2003 20:04:02 +0800 Sender: ntg-context-admin@ntg.nl Message-ID: Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045223822 21073 80.91.224.249 (14 Feb 2003 11:57:02 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 14 Feb 2003 11:57:02 +0000 (UTC) Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18jeSg-0005TA-00 for ; Fri, 14 Feb 2003 12:56:58 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 94C6510AF0; Fri, 14 Feb 2003 12:59:14 +0100 (MET) Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by ref.ntg.nl (Postfix) with ESMTP id 2F70F10AE9 for ; Fri, 14 Feb 2003 12:57:19 +0100 (MET) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18jeQn-0005MW-00 for ; Fri, 14 Feb 2003 12:55:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ntg-context@ref.ntg.nl Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18jeQn-0005MN-00 for ; Fri, 14 Feb 2003 12:55:01 +0100 Original-Lines: 6 Original-X-Complaints-To: usenet@main.gmane.org User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:11028 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:11028 I've looked at the verb-XML module, and verb-ini module, and have have seen hints that it may be possible to typeset XML code snippets, such as into the main text. Is it possible to inline such XML expressions into the main text, using the same color setup as has been defined in the verb-XML macros? From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/11057 Path: main.gmane.org!not-for-mail From: Guy Worthington Newsgroups: gmane.comp.tex.context Subject: Re: inlining pretty-printed XML Date: 16 Feb 2003 17:03:27 +0800 Sender: ntg-context-admin@ntg.nl Message-ID: References: Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045385748 17217 80.91.224.249 (16 Feb 2003 08:55:48 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 16 Feb 2003 08:55:48 +0000 (UTC) Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18kKaR-0004TZ-00 for ; Sun, 16 Feb 2003 09:55:47 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 4FCAE10AF0; Sun, 16 Feb 2003 09:58:07 +0100 (MET) Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by ref.ntg.nl (Postfix) with ESMTP id 7ADD210AE7 for ; Sun, 16 Feb 2003 09:56:43 +0100 (MET) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18kKZ3-0004QZ-00 for ; Sun, 16 Feb 2003 09:54:21 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ntg-context@ref.ntg.nl Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18kKZ2-0004QQ-00 for ; Sun, 16 Feb 2003 09:54:20 +0100 Original-Lines: 39 Original-X-Complaints-To: usenet@main.gmane.org User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:11057 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:11057 I'm seem to be using this mailing list as private correspondence, I'll try to keep my posting down in future. But.. Following up on my question on how to inline XML code, I vaguely remember reading that the TeX primitive \par, has no effect in restricted horizontal mode, (I think that's what it's called, anyways the horizontal mode that's not paragraph mode). So on that assumption, I forced the verbatim pretty printer to operate inside an \hbox, with the following code: -------------------------------------------------- %output=pdf \definetyping [XMLtag] [option=XML] \setuptyping [XMLtag] [before={\ \hbox\bgroup}, after={\egroup\ }, palet=colorpretty] \setupcolors[state=start] \starttext This is a \startXMLtag
\stopXMLtag tag inline; and this is a comment \startXMLtag \stopXMLtag \startXML
\stopXML \stoptext -------------------------------------------------- From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/11073 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Re: inlining pretty-printed XML Date: Mon, 17 Feb 2003 02:14:19 +0100 Sender: ntg-context-admin@ntg.nl Message-ID: <5.1.0.14.1.20030217011932.02ce5ec0@remote-1> References: Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1045472890 29954 80.91.224.249 (17 Feb 2003 09:08:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 17 Feb 2003 09:08:10 +0000 (UTC) Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18khFu-0007mn-00 for ; Mon, 17 Feb 2003 10:08:06 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 7A4F510ABB; Mon, 17 Feb 2003 10:10:27 +0100 (MET) Original-Received: from mail.solcon.nl (mail.solcon.nl [212.45.33.11]) by ref.ntg.nl (Postfix) with ESMTP id 4FC4910AB6 for ; Mon, 17 Feb 2003 10:07:00 +0100 (MET) Original-Received: from server-1.pragma-ade.nl (wc-58016.solcon.nl [212.45.58.16]) by mail.solcon.nl (8.12.5/pre1.0-MySQL/8.12.5) with ESMTP id h1H96teP029137 for ; Mon, 17 Feb 2003 10:06:55 +0100 Original-Received: from LAPTOP-3.wxs.nl (laptop-3 [10.100.1.191]) by server-1.pragma-ade.nl (8.12.3/8.12.2) with ESMTP id h1H96ut7020088 for ; Mon, 17 Feb 2003 10:06:57 +0100 X-Sender: hagen-mail@server-1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Original-To: ntg-context@ntg.nl In-Reply-To: X-RAVMilter-Version: 8.4.1(snapshot 20020919) (mail.solcon.nl) Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:11073 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:11073 At 05:03 PM 2/16/2003 +0800, Guy Worthington wrote: >I'm seem to be using this mailing list as private correspondence, I'll >try to keep my posting down in future. But.. > >Following up on my question on how to inline XML code, I vaguely >remember reading that the TeX primitive \par, has no effect in >restricted horizontal mode, (I think that's what it's called, anyways >the horizontal mode that's not paragraph mode). So on that >assumption, I forced the verbatim pretty printer to operate inside an >\hbox, with the following code: > >-------------------------------------------------- > >%output=pdf >\definetyping [XMLtag] [option=XML] >\setuptyping [XMLtag] [before={\ \hbox\bgroup}, > after={\egroup\ }, > palet=colorpretty] > >\setupcolors[state=start] > >\starttext > >This is a >\startXMLtag >
>\stopXMLtag >tag inline; and this is a comment >\startXMLtag > >\stopXMLtag > >\startXML > >
>\stopXML > >\stoptext did you try: \setupcolors[state=start] \definetype[typeXML][option=XML,palet=colorpretty] test \typeXML{} test \startXML \stopXML (ps i just found out that the palet is not predefined here, but the previous code should work ok) Another nice one is: %\setupXMLfile[level=2] %\showXMLlin[here,there] %\showXMLwrd[whow] (ign,lin,wrd,par,txt,nop,emp) \startbuffer oeps \stopbuffer \showXMLbuffer there is also \showXMLfile i'll add an \showXMLtext{ oeps } \showXMLtext{oeps} this trickery is used in: texexec --pdf --use=xml-01 somexmlfile [--mode=packed,wide] : use pdftotext afterwards and you'll have a prettier xml file texexec --pdf --use=xml-02 somexmlfile : pretty print (recognized xsd, rlg, xml, exa) Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf ------------------------------------------------------------------------- From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/11078 Path: main.gmane.org!not-for-mail From: Guy Worthington Newsgroups: gmane.comp.tex.context Subject: Re: inlining pretty-printed XML Date: 18 Feb 2003 21:23:51 +0800 Sender: ntg-context-admin@ntg.nl Message-ID: References: <5.1.0.14.1.20030217011932.02ce5ec0@remote-1> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045574216 17618 80.91.224.249 (18 Feb 2003 13:16:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 18 Feb 2003 13:16:56 +0000 (UTC) Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18l7cE-0004Zu-00 for ; Tue, 18 Feb 2003 14:16:54 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id E94AA10AEC; Tue, 18 Feb 2003 14:19:16 +0100 (MET) Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by ref.ntg.nl (Postfix) with ESMTP id 64C7F10AB6 for ; Tue, 18 Feb 2003 14:17:19 +0100 (MET) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18l7aG-0004QC-00 for ; Tue, 18 Feb 2003 14:14:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ntg-context@ref.ntg.nl Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18l7aE-0004Pn-00 for ; Tue, 18 Feb 2003 14:14:50 +0100 Original-Lines: 48 Original-X-Complaints-To: usenet@main.gmane.org User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:11078 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:11078 Hans Hagen wrote: > [to inline xml] try: > \setupcolors[state=start] > > \definetype[typeXML][option=XML,palet=colorpretty] > > test \typeXML{} test The code works, and, as usual, you've upstaged me with a much cleaner interface. > Another nice one is: > > %\setupXMLfile[level=2] > %\showXMLlin[here,there] > %\showXMLwrd[whow] > > (ign,lin,wrd,par,txt,nop,emp) > > \startbuffer > oeps > \stopbuffer > > \showXMLbuffer > > there is also \showXMLfile Hans, you make life hard. I've been playing around with this, this afternoon, it's like magic. But now I've got to rethink how I format XML to exploit the pretty-printing capability, especially how I should group elements. > this trickery is used in: > > $ texexec --pdf --use=xml-01 somexmlfile [--mode=packed,wide] > > use pdftotext afterwards and you'll have a prettier xml file Do you wake up in the morning and think to yourself I'll build a better version of lgrind? This I can use immediately. Thankyou. > $ texexec --pdf --use=xml-02 somexmlfile > > pretty print (recognized xsd, rlg, xml, exa) And it also comes in colour. From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/11079 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Re: inlining pretty-printed XML Date: Tue, 18 Feb 2003 15:55:52 +0100 Sender: ntg-context-admin@ntg.nl Message-ID: <5.1.0.14.1.20030218155250.0231d060@server-1> References: <5.1.0.14.1.20030217011932.02ce5ec0@remote-1> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1045580159 15451 80.91.224.249 (18 Feb 2003 14:55:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 18 Feb 2003 14:55:59 +0000 (UTC) Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18l9A6-000414-00 for ; Tue, 18 Feb 2003 15:55:58 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 4DAEA10AE8; Tue, 18 Feb 2003 15:58:21 +0100 (MET) Original-Received: from mail.solcon.nl (mail.solcon.nl [212.45.33.11]) by ref.ntg.nl (Postfix) with ESMTP id 48E7110AB6 for ; Tue, 18 Feb 2003 15:56:01 +0100 (MET) Original-Received: from server-1.pragma-ade.nl (wc-58016.solcon.nl [212.45.58.16]) by mail.solcon.nl (8.12.5/pre1.0-MySQL/8.12.5) with ESMTP id h1IEttR9032046 for ; Tue, 18 Feb 2003 15:55:55 +0100 Original-Received: from LAPTOP-3.wxs.nl (laptop-3 [10.100.1.191]) by server-1.pragma-ade.nl (8.12.3/8.12.2) with ESMTP id h1IEtxt5027011 for ; Tue, 18 Feb 2003 15:55:59 +0100 X-Sender: hagen-mail@server-1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Original-To: ntg-context@ntg.nl In-Reply-To: X-RAVMilter-Version: 8.4.1(snapshot 20020919) (mail.solcon.nl) Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:11079 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:11079 At 09:23 PM 2/18/2003 +0800, Guy Worthington wrote: >Hans, you make life hard. I've been playing around with this, this >afternoon, it's like magic. But now I've got to rethink how I >format XML to exploit the pretty-printing capability, especially how I >should group elements. Say that you use relax ng, have the following def's in, say, eximple.rng: ..... then you can say: \definefilesynonym [eximple] [eximple.rng] and later on pick up the components: \showRNGcomponent[eximple][framework] saves you some work and make documentation in a separate file easier Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------