From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/10085 Path: main.gmane.org!not-for-mail From: Simon Pepping Newsgroups: gmane.comp.tex.context Subject: Re: DocBookInConTeXt customization? Date: Mon, 9 Dec 2002 21:09:57 +0100 Sender: ntg-context-admin@ntg.nl Message-ID: <20021209200956.GA1164@scaprea> References: <20021208151217.GA15406@mail.inet.hr> <4224182C-0AC2-11D7-B0AD-0050E4258255@fastmail.fm> <20021208195429.GA20944@inet.hr> 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 1039468965 17135 80.91.224.249 (9 Dec 2002 21:22:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 9 Dec 2002 21:22:45 +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 18LVMR-0004SB-00 for ; Mon, 09 Dec 2002 22:22:43 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id C9D7A10AE8; Mon, 9 Dec 2002 22:22:48 +0100 (MET) Original-Received: from hgatenl.hobby.nl (ns.hobby.nl [212.72.224.8]) by ref.ntg.nl (Postfix) with ESMTP id 7B6D510AE7 for ; Mon, 9 Dec 2002 22:21:01 +0100 (MET) Original-Received: from hgatenl.hobby.nl (localhost [127.0.0.1]) by hgatenl.hobby.nl (8.12.5/8.12.2) with ESMTP id gB9LKuIF036542 for ; Mon, 9 Dec 2002 22:20:56 +0100 (CET) (envelope-from spepping@scaprea.hobby.nl) Original-Received: (from uucp@localhost) by hgatenl.hobby.nl (8.12.5/8.12.2/Submit) with UUCP id gB9LKuEO036541 for ntg-context@ntg.nl; Mon, 9 Dec 2002 22:20:56 +0100 (CET) Original-Received: from simon by scaprea.salix.nl with local (Exim 3.35 #1 (Debian)) id 18LUE1-0000Tr-00; Mon, 09 Dec 2002 21:09:57 +0100 Original-To: ntg-context@ntg.nl Mail-Followup-To: ntg-context@ntg.nl Content-Disposition: inline In-Reply-To: <20021208195429.GA20944@inet.hr> User-Agent: Mutt/1.3.28i 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:10085 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:10085 On Sun, Dec 08, 2002 at 08:54:29PM +0100, Gour wrote: > I'd like something like: > > dic* > DocBook -------> ConTeXt ----> output > > *dic = DocBookInConTeXt module It is like you say at the top, but the context document is built on the fly, i.e., it only exists in memory, and it never exists in its entirety. It may be better to think of the XML file as the input file for context. This is possible because the < is an active character that invokes macro processing. Context's XML layer enables the conversion author to write a mapping from XML tag to context commands: when that tag is read, the corresponding context commands are invoked. As Hans replies in a later email in this thread, the best strategy is to map to existing context environments. I have done this as much as possible. Then you can customize that environment after reading the docbook module but before the XML file is input. For example, docbook tables are typeset using context's 'natural table' environment. So, if you would set \setupTABLE[background=color,backgroundcolor=red], you would get that (according to theory, I still have to test that). I test the docbook module with a tex file containing the following lines after inputing the docbook module: \setupinteraction[state=start,color=blue] \setupindenting[medium] \setupheadertexts[section][pagenumber] \setupheader[leftwidth=.7\hsize,style=slanted] \setuppagenumbering[location=] \setupitemize[each][packed][before=,after=,indentnext=no] The table element also shows that you cannot arbitrarily customize the output. The docbook module reads the colspec and col- and rowsep settings from the table in the XML file, and applies the appropriate settings, thus overwriting your settings. In this case that is appropriate, because the XML file has priority over your settings. I will try to document the customization options for the docbook module somewhere after Christmas. > which is similar to XSL toolchain: > > xslt fop > DocBook ------> XSL-FO -----> output > > with the exception that ConTeXt format is more user-friendly & capable than > xsl-fo format, and produces best quality output. I am not sure that this is a good parallel. FO's are not customizable; the XSLT stylesheets may be. And context could serve as the FO processor, by the same mechanism of a mapping of FO's to context, if someone would write it. That is what PassiveTeX does for latex. > With time, one can also expect that DocBookInConText module will get more users' > input and be able to map more DocBook elements. That would be welcome. Regards, Simon -- Simon Pepping email: spepping@scaprea.hobby.nl