You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by David Crossley <cr...@indexgeo.com.au> on 2001/11/21 16:08:06 UTC
List of Docs - new sample and doco functionality
I just added a new sample and new documentation functionality
(to HEAD only) that generates a "List of docs". This aggregates
all **/book.xml and renders and normal doc page. This works
nicely and gives a one-page listing of all Cocoon documentation.
See Welcome page or from the Main side-panel.
However, it needs to link to each document and i cannot
find a way to generate the link. After all of the book.xml files
have been aggregated, we only have relative URIs available.
For example, when the stylesheet is dealing with
xdocs/userdocs/concepts/book.xml then it only gets relative
href=filename.html for each of this book's documents. Instead
we need to know href=userdocs/concepts/filename.html
The map:aggregate and map:part are not yet documented, so i
am not sure how they work. Is it possible that they can provide
such metadata about the document?
A last resort approach would be to hard-code this value inside
each book.xml as an attribute of the <book> element.
Please try the new functionality - hopefully you can see a solution.
--David
---------------------
documentation/sitemap.xmap
...
<map:match pattern="body-doclist.xml">
<map:aggregate element="doclist">
<map:part src="xdocs/book.xml"/>
<map:part src="xdocs/installing/book.xml"/>
<map:part src="xdocs/ctwig/book.xml"/>
<map:part src="xdocs/userdocs/book.xml"/>
<map:part src="xdocs/userdocs/concepts/book.xml"/>
<map:part src="xdocs/userdocs/generators/book.xml"/>
<map:part src="xdocs/userdocs/transformers/book.xml"/>
<map:part src="xdocs/userdocs/serializers/book.xml"/>
<map:part src="xdocs/userdocs/matchers/book.xml"/>
<map:part src="xdocs/userdocs/selectors/book.xml"/>
<map:part src="xdocs/userdocs/actions/book.xml"/>
<map:part src="xdocs/userdocs/xsp/book.xml"/>
<map:part src="xdocs/developing/book.xml"/>
</map:aggregate>
<map:transform src="stylesheets/doclist2document.xsl"/>
<map:transform src="stylesheets/document2html.xsl"/>
<map:serialize type="html"/>
</map:match>
---------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: List of Docs as Table of Contents
Posted by Bernhard Huber <be...@a1.net>.
Hi,
i have changed sitemap to:
<!-- Generate the Table of Contents
The first match generates each book.xml and adds a new element "path".
The second match aggregates each book.xml into a doclist and
then converts it to a document.
-->
<map:match pattern="doclist/xdocs/**book.xml">
<map:generate src="xdocs/{1}book.xml"/>
<map:transform src="stylesheets/doclist.xsl">
<map:parameter name="use-request-parameters" value="true"/>
<map:parameter name="path" value="{1}"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="body-doclist.xml">
<map:aggregate element="doclist">
<map:part src="cocoon:/doclist/xdocs/book.xml"/>
<map:part src="cocoon:/doclist/xdocs/installing/book.xml"/>
<!--map:part src="cocoon:/doclist/xdocs/ctwig/book.xml"/>
<map:part src="cocoon:/doclist/xdocs/userdocs/book.xml"/>
<map:part src="cocoon:/doclist/xdocs/userdocs/concepts/book.xml"/>
<map:part src="cocoon:/doclist/xdocs/userdocs/generators/book.xml"/>
<map:part
src="cocoon:/doclist/xdocs/userdocs/transformers/book.xml"/>
<map:part src="cocoon:/doclist/xdocs/userdocs/serializers/book.xml"/>
<map:part src="cocoon:/doclist/xdocs/userdocs/matchers/book.xml"/>
<map:part src="cocoon:/doclist/xdocs/userdocs/selectors/book.xml"/>
<map:part src="cocoon:/doclist/xdocs/userdocs/actions/book.xml"/>
<map:part src="cocoon:/doclist/xdocs/userdocs/xsp/book.xml"/>
<map:part src="cocoon:/doclist/xdocs/developing/book.xml"/-->
</map:aggregate>
<map:transform src="stylesheets/doclist2document.xsl"/>
<map:transform src="stylesheets/document2html.xsl"/>
<map:serialize type="html"/>
</map:match>
and "build docs" does not throw an exception.
I think its strange that the doclist page is still correct.
I have no explanation for the stacktrace.
>This led me to wonder about efficiency issues. Surely
>there is more than one way to solve such a problem.
>Does sitemap efficiency matter? If so, then we need to
>start a user tips document.
>
A solution might be to use the directory generator to get a list of all
book.xml documents. I have not tried it yet, but I think that might be
faster and more elegant solution.
bye bernhard
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
List of Docs as Table of Contents
Posted by David Crossley <cr...@indexgeo.com.au>.
The Cocoon Sample "List of Docs" is now working
properly, building the hyperlinks for each document.
Reach it via the "docs" section of the Welcome page,
or via the side-panel of a top-level document page.
I found a solution to the relative URI issue described
below. In documentation/sitemap.xmap i simply defined
another match to append a new <path> element to each
<book> entry, to provide the pathname of each book to
the final stylesheet. The map:aggregate then adds each
map:part via a cocoon:/ URI.
This led me to wonder about efficiency issues. Surely
there is more than one way to solve such a problem.
Does sitemap efficiency matter? If so, then we need to
start a user tips document.
--David
On 22 Nov 2001 David Crossley wrote:
> I just added a new sample and new documentation functionality
> (to HEAD only) that generates a "List of docs". This aggregates
> all **/book.xml and renders and normal doc page. This works
> nicely and gives a one-page listing of all Cocoon documentation.
> See Welcome page or from the Main side-panel.
>
> However, it needs to link to each document and i cannot
> find a way to generate the link. After all of the book.xml files
> have been aggregated, we only have relative URIs available.
>
> For example, when the stylesheet is dealing with
> xdocs/userdocs/concepts/book.xml then it only gets relative
> href=filename.html for each of this book's documents. Instead
> we need to know href=userdocs/concepts/filename.html
>
> The map:aggregate and map:part are not yet documented, so i
> am not sure how they work. Is it possible that they can provide
> such metadata about the document?
>
> A last resort approach would be to hard-code this value inside
> each book.xml as an attribute of the <book> element.
>
> Please try the new functionality - hopefully you can see a solution.
> --David
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org