From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24158 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: An idea Date: Tue, 06 Dec 2005 10:11:18 +0100 Message-ID: <439555B6.8030509@wxs.nl> References: <20051201162914.GA14497@fly.srk.fer.hr> <20051202165636.GA8858@puritan.petwork> <20051202174653.GB3376@fly.srk.fer.hr> <20051202184337.GB8858@puritan.petwork> <20051203194557.GA8903@puritan.petwork> <43933C98.20107@wxs.nl> <20051204191439.GA12372@puritan.petwork> <439353D5.4070704@wxs.nl> <20051205204809.GD19534@puritan.petwork> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1133860360 750 80.91.229.2 (6 Dec 2005 09:12:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Dec 2005 09:12:40 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Dec 06 10:12:38 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1EjYrE-0005cb-OB for gctc-ntg-context-518@m.gmane.org; Tue, 06 Dec 2005 10:11:32 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 343A712831; Tue, 6 Dec 2005 10:11:31 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 29670-02; Tue, 6 Dec 2005 10:11:25 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D7E791281E; Tue, 6 Dec 2005 10:11:24 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 07D301281E for ; Tue, 6 Dec 2005 10:11:23 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 29635-04 for ; Tue, 6 Dec 2005 10:11:21 +0100 (CET) Original-Received: from controller-1 (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with ESMTP id 22E3312815 for ; Tue, 6 Dec 2005 10:11:20 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 6558 for ; Tue, 06 Dec 2005 10:17:03 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <20051205204809.GD19534@puritan.petwork> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:24158 Archived-At: Nikolai Weibull wrote: >That=E2=80=99s just horrendous. The =E2=80=98n=E2=80=99 attribute on =E2= =80=98line=E2=80=99 is useless (and why >are empty lines unnumbered?). You can just as easily use XSLT=E2=80=99s > to get that effect: > =20 > if i remember right it has to to with the fact that while editing=20 inserted lines were treated different (sub numbers and such) so n is not=20 om forehand something going up in steps of 1; it's more a status thing >Furthermore, the =E2=80=98n=E2=80=99 attribute on =E2=80=98t=E2=80=99 is= equally useless. How am I to >know what =E2=80=9C3=E2=80=9D stands for when converting? > =20 > in scite that's related to styles which have numbers (no symbolic names) >Finally, what=E2=80=99s the reason for having =E2=80=98s=E2=80=99? It j= ust complicates matters >immensely: > > > > > > > =20 > having access to spaces (without the need to xslt the file) can be handy=20 if you want to treat them special (e.g. visualize them); keep in mind=20 that in xml mode we don't have active character trickery available actually, it's one of the reasons why i dislike cdata being used for=20 verbose content instead of tagged content ... is easier to interface to certain typesetting things btw, when we process xml here, i often have to preprocess the files=20 (using ruby and regexps) just in order to add some detail that permits=20 proper typesetting > > > 0"> > > > > > > > >The problem is that the =E2=80=98n=E2=80=99 attribute has a default of 1= , but as there=E2=80=99s >no way to express default values for attributes in Relax-NG (and there=E2= =80=99s >no schema at the bogus url http://www.scintila.org/scite.rng) we=E2=80=99= d have >to hack it even more. > >Could you enlighten me on the merits of having a tag for representing >(sequences of) whitespace? > =20 > as said, in order to be able to treat them kind of special btw, it's all configurable: export.xml.collapse.spaces=3D1 export.xml.collapse.lines=3D1 so .. it's just what i needed (at that time) which was an alternative=20 for the latex output mode that i could not use >Here=E2=80=99s a suggestion for a better grammar: > >ID.datatype =3D xsd:ID >LanguageCode.datatype =3D xsd:language > >id.attrib =3D attribute id { ID.datatype }? >xmlbase.attrib =3D attribute xml:base { text }? >Core.attrib =3D id.attrib, xmlbase.attrib >lang.attrib =3D attribute xml:lang { LanguageCode.datatype }? >I18n.attrib =3D lang.attrib >Common.attrib =3D Core.attrib, I18n.attrib > >start =3D file | line | segment | whitespace > >file =3D element file { file.attlist, file.content } >file.attlist =3D Common.attrib, attribute path { text }, attribute type = { text } >file.content =3D line* > >line =3D element line { line.attlist, line.content } >line.attlist =3D Common.attrib >line.content =3D (segment | whitespace)* > >segment =3D element segment { segment.attlist, text } >segment.attlist =3D Common.attrib, attribute type { text } > >whitespace =3D element whitespace { whitespace.attlist, empty } >whitespace.attlist =3D Common.attrib > >I=E2=80=99m sure that there are things missing and that it can be improv= ed >further, but it=E2=80=99s a good start in my opinion. > >What I can=E2=80=99t decide is whether to write things like > > > inta; > > >or > > > inta; > > >The first scheme is easier to extend with more types, if we don=E2=80=99= t >validate the value of segment=E2=80=99s =E2=80=98type=E2=80=99 attribute= (if we do, then both >schemes are equally =E2=80=9Ceasy=E2=80=9D to extend), but the second sc= heme has the >benefit that as much validation as possible can go into the schema and >can thus ease translation. > >I envision that the XSLT ConTeXt-converter for this scheme would have >code in one of these two formats: > > > \highlight[]{} > > >or > > > \highlight[]{} > > >I really don=E2=80=99t know what I prefer. The first means that only th= e source >and destination need to worry about dealing with new types (the >stylesheet can be used unchanged). > =20 > it depends a bit on what an editor can provide; the scite xml output is=20 rather connected to its lexer, and since each lexer is different there=20 is no strict relationship between a number and e.g. a type. As a result,=20 stylesheets need to have that kind of (conversion) knowledge. it's not clear to me how you want to use these code snippets - if you're going to copy them into your tex document, i'd leave them in=20 xml format, i.e. have a mixed tex/xml doc (no need for conversion since=20 we're dealing with rather simple xml->tex mapping sthat can be done by=20 context itself) - if you keep them in the source file, you need a way to filter them=20 into your main text document (this is what i do when i nedd to document=20 for stylesheets and such: i filter the pieces i needed while typesetting) >>about an article ... it would be interesting to combine thsi with a kin= d=20 >>of literate programming >> =20 >> > >Yes, that=E2=80=99s true. I used a simple hack to my code written in li= terate >programming into my master=E2=80=99s thesis. It worked quite well actua= lly. >I=E2=80=99m sure that this could be combined with the method I used ther= e. > =20 > so how does this work? some text [reference to code snippet] some more text where you merge in the code snippets before processing? > =20 > >>(if cweb would produce better output then it may have become a bit >>more popular) >> =20 >> > >Yes. I see three problems with CWEB: > >1. The syntax is too complicated >2. The output is not great >3. The input isn=E2=80=99t compilable in the source programming languag= e > >What my literate programming system did was allow for embedding comments >in the source instead of the other way around (much like how ConTeXt >sources are documented). This worked very well actually, especially in >the parts of my code that were written in Ruby where one can do things >like > ># =C2=B6 OK, so now that we have all the other methods done, it=E2=80=99= s time to ># write our final method \Ruby{method}. It will simply tie together the ># other methods found in \Ruby{Class}: > =20 > why not # write our final method \RubyM[Class.method]. It will simply tie togeth= er the # other methods found in \RubyC[Class.method]: and let that info be auto-inserted? Now you have to edit three (probably=20 more) places when you change the name of the method. >def Class.method > =E2=8B=AE >end > >(A sequence of comments where the first comment began with a pilcrow >sign are processed as stuff to send to ConTeXt and the following code >block (basically everything up to the next pilcrow-endowned comment) was >set inside a verbatim environment.) > >Anyway, I=E2=80=99ve attached the Relax-NG schema that I deviced. Tomor= row I=E2=80=99m >going to work on writing an exporter that exports to this format and a >stylesheet that transforms this to ConTeXt code. If I have time I=E2=80= =99ll >also try to set up some environment for this and some generic >preprocessing directives for texexec. > =20 > ok Hans