Maven Doxia

Request for a TOC-like feature

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

If it is possible, I would like to request for a TOC like functionality that will generate links to certain headers (section, subsection, etc) on the document.

Activity

Hide
Vincent Siveton added a comment -

FYI, Trygve Laugstol commits a doxia-book project to make books in Doxia.
http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-sandbox/doxia-book/

Show
Vincent Siveton added a comment - FYI, Trygve Laugstol commits a doxia-book project to make books in Doxia. http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-sandbox/doxia-book/
Hide
Jörg Hohwiller added a comment -

I have the same need for the TOC feature and I have seen many projects out there that maintain TOCs in their xdocs manually, what really sucks.
I asked for this feature on the maven users list (29.10.2006 21:42) and the developers list (17.11.2006 21:05) without getting a single response.
Could you doxia developers at least comment this issue... Thanks in advance.

Show
Jörg Hohwiller added a comment - I have the same need for the TOC feature and I have seen many projects out there that maintain TOCs in their xdocs manually, what really sucks. I asked for this feature on the maven users list (29.10.2006 21:42) and the developers list (17.11.2006 21:05) without getting a single response. Could you doxia developers at least comment this issue... Thanks in advance.
Hide
Vincent Siveton added a comment -

I did a macro on trunk to handle that.

For instance, in an apt file, you could write:

%{toc|section=2|fromDepth=1|toDepth=2}

and in xdoc file

<macro name="toc" section="1" fromDepth="1" toDepth="2"/>

Some explanations on parameters (from javadoc):

section
Display the specificated section number or all sections if 0 (in this case, other paramaters are ignored).
Positive int, not mandatory, 0 by default.

fromDepth
Display the depth starting for the given section number.
Positive int, not mandatory, 0 by default.

toDepth
Display the depth ending for the given section number.
Positive int, not mandatory, 5 by default.

I let it open to be sure that it solve your requirements

Show
Vincent Siveton added a comment - I did a macro on trunk to handle that. For instance, in an apt file, you could write:
%{toc|section=2|fromDepth=1|toDepth=2}
and in xdoc file
<macro name="toc" section="1" fromDepth="1" toDepth="2"/>
Some explanations on parameters (from javadoc): section Display the specificated section number or all sections if 0 (in this case, other paramaters are ignored). Positive int, not mandatory, 0 by default. fromDepth Display the depth starting for the given section number. Positive int, not mandatory, 0 by default. toDepth Display the depth ending for the given section number. Positive int, not mandatory, 5 by default. I let it open to be sure that it solve your requirements
Hide
Jason van Zyl added a comment -

Vincent has created a macro for this.

Show
Jason van Zyl added a comment - Vincent has created a macro for this.
Hide
Jörg Hohwiller added a comment -

Thanks, that sounds excellent.
Could you provide a link with documentation how I could test this from trunk or is there a snapshot I could use?

Show
Jörg Hohwiller added a comment - Thanks, that sounds excellent. Could you provide a link with documentation how I could test this from trunk or is there a snapshot I could use?
Hide
Lukas Theussl added a comment -

This was done in alpha-9, so it's included in site plugin 2.0-beta-6. See http://maven.apache.org/doxia/macros/index.html.

Show
Lukas Theussl added a comment - This was done in alpha-9, so it's included in site plugin 2.0-beta-6. See http://maven.apache.org/doxia/macros/index.html.
Hide
Jörg Hohwiller added a comment -

BTW: Works excellent, thanks!

Show
Jörg Hohwiller added a comment - BTW: Works excellent, thanks!
Hide
Jörg Hohwiller added a comment -

Maybe someone can have a look at MSITE-377
I am NOT too sure wheter this is a problem of the site plugin or doxia.

Show
Jörg Hohwiller added a comment - Maybe someone can have a look at MSITE-377 I am NOT too sure wheter this is a problem of the site plugin or doxia.
Hide
Albert Kurucz added a comment -

The toc macro works great!
But.

It would be nice to make it CSS friendly with an divId= and/or divClass= parameter.

If divId or div/Class parameter exists, the toc macro should change the enclosing <div class="section"> accordingly.
If there is no enclosing <div class="section">, then create an additional <div> around the generated <ul><li> structure, which has the id/class as specified.

Show
Albert Kurucz added a comment - The toc macro works great! But. It would be nice to make it CSS friendly with an divId= and/or divClass= parameter. If divId or div/Class parameter exists, the toc macro should change the enclosing <div class="section"> accordingly. If there is no enclosing <div class="section">, then create an additional <div> around the generated <ul><li> structure, which has the id/class as specified.
Hide
Lukas Theussl added a comment -

Issue to watch: DOXIA-320

Show
Lukas Theussl added a comment - Issue to watch: DOXIA-320

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: