Return-Path: Delivered-To: apmail-maven-doxia-dev-archive@www.apache.org Received: (qmail 59243 invoked from network); 28 Apr 2008 19:19:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Apr 2008 19:19:22 -0000 Received: (qmail 4873 invoked by uid 500); 28 Apr 2008 19:19:24 -0000 Delivered-To: apmail-maven-doxia-dev-archive@maven.apache.org Received: (qmail 4847 invoked by uid 500); 28 Apr 2008 19:19:24 -0000 Mailing-List: contact doxia-dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: doxia-dev@maven.apache.org Delivered-To: mailing list doxia-dev@maven.apache.org Received: (qmail 4833 invoked by uid 99); 28 Apr 2008 19:19:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Apr 2008 12:19:24 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [212.27.42.28] (HELO smtp2-g19.free.fr) (212.27.42.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Apr 2008 19:18:31 +0000 Received: from smtp2-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp2-g19.free.fr (Postfix) with ESMTP id 1ED2912B6EA for ; Mon, 28 Apr 2008 21:18:50 +0200 (CEST) Received: from [192.168.0.11] (lam60-1-82-233-128-14.fbx.proxad.net [82.233.128.14]) by smtp2-g19.free.fr (Postfix) with ESMTP id 7812112B6FA for ; Mon, 28 Apr 2008 21:18:45 +0200 (CEST) Message-Id: <858FD30D-31BF-4DED-8332-2E30589EC418@massol.net> From: Vincent Massol To: doxia-dev@maven.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: The need for multiple passes over a document Date: Mon, 28 Apr 2008 21:18:44 +0200 References: X-Mailer: Apple Mail (2.919.2) X-Virus-Checked: Checked by ClamAV on apache.org On Apr 28, 2008, at 3:49 PM, Jason van Zyl wrote: > I was looking at the TOC macro and I feel what it's doing is wrong > insofar as requiring a second pass to get the structure of the > document. > > There are definitely cases where you need to make multiple passes > and the TOC macro is clearly one of them. Having to pass in the the > whole source document and the parser to make the TOC macro work seem > extreme to me. > > I think that we should declaratively say, or determine, that the > structure of the document is required by something in the page. > Preprocess the page in a general way and not require passing in the > whole document and parser again as that's pretty cumbersome for the > implementor of a parser. In XWiki land, I parse the document once, which generates an AST of Blocks. Then this AST is passed to macros. Note that one reason we build an in memory AST is to cache it in order to serve pages faster (no need to reparse static elements - only macros are reparsed). -Vincent > I also noticed that the parsers are not threadsafe, I don't believe > this was always the case and we should make them threadsafe again if > it's true they aren't. I just looked at the APT parser and it > doesn't look threadsafe to me but wouldn't take much to make it > threadsafe. > > I would like to take a pass at making the document structure > requirement more general to avoid things like we're doing in the TOC > macro. I would also like to take a pass at making the parsers > threadsafe. > > I think we should also just release 1.0 for the sake of the site > plugin and then move on with the next version of Doxia. We need to > remove the coupling of doxia to the site plugin and move the core > back to a simple set of parsers and sinks. > > Thanks, > > Jason