Maven Doxia

Improve toc macro for CSS

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.1
  • Fix Version/s: 1.1.1
  • Component/s: Core
  • Labels:
    None
  • Environment:
    any
  • Number of attachments :
    0

Description

The toc macro in APT works great!
example: %{toc|section=0}

But.

It would be nice to make it CSS friendly with an divId= and/or divClass= parameter.
example: %{toc|section=0|divID=myTOC}

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.

Issue Links

Activity

Hide
Albert Kurucz added a comment - - edited

Even better:
It would be nice if the divID parameter exists, then the generated TOC, should show outside of both
<div id="bodyColumn">
<div id="contentBox">

(with the speficied id).
This would allow the CSS programmer to put the TOC into the navigation column, where it really belongs.

Show
Albert Kurucz added a comment - - edited Even better: It would be nice if the divID parameter exists, then the generated TOC, should show outside of both <div id="bodyColumn"> <div id="contentBox"> (with the speficied id). This would allow the CSS programmer to put the TOC into the navigation column, where it really belongs.
Hide
Lukas Theussl added a comment -

I have committed a basic implementation, see r773896. I have also deployed a doxia snapshot (v. 1.1.1-SNAPSHOT) to test.

You can now add any html base attribute as a toc macro parameter, eg

%{toc|section=2|fromDepth=1|toDepth=1|id=myId|class=myClass}

this will add the parameters to the list tag:

<ul id="myId" class="myClass">...

It is possible to wrap the <ul> in a <div id=""...> if this is desired.

Whether the toc appears inside a <div class="section"> depends on whether the toc declaration appears within a section in the source document. Just move it outside if you don't want it there.

I do not see a way to move the toc outside the bodyColumn or the contentBox as these are put in place by the siterenderer, ie outside doxia, after the sourc docs have been parsed.

Show
Lukas Theussl added a comment - I have committed a basic implementation, see r773896. I have also deployed a doxia snapshot (v. 1.1.1-SNAPSHOT) to test. You can now add any html base attribute as a toc macro parameter, eg
%{toc|section=2|fromDepth=1|toDepth=1|id=myId|class=myClass}
this will add the parameters to the list tag:
<ul id="myId" class="myClass">...
It is possible to wrap the <ul> in a <div id=""...> if this is desired. Whether the toc appears inside a <div class="section"> depends on whether the toc declaration appears within a section in the source document. Just move it outside if you don't want it there. I do not see a way to move the toc outside the bodyColumn or the contentBox as these are put in place by the siterenderer, ie outside doxia, after the sourc docs have been parsed.
Hide
Albert Kurucz added a comment -

It would be so nice if the Site renderer could create a vertical menu from the TOC, like this site has (mine):
http://www.jtstand.com/

I think the <div> of TOC should be outside of the bodyColumn and the contentBox to be able to do this.
Correct me if I am wrong!

Show
Albert Kurucz added a comment - It would be so nice if the Site renderer could create a vertical menu from the TOC, like this site has (mine): http://www.jtstand.com/ I think the <div> of TOC should be outside of the bodyColumn and the contentBox to be able to do this. Correct me if I am wrong!
Hide
Lukas Theussl added a comment -

I don't think the TOC macro was meant to provide this functionality. It was designed to work within single pages, not whole sites (DOXIA-40).

What you want should rather be accomplished by some outside plugin, like the site plugin does with site.xml, and I am currently thinking about the same functionality for the pdf plugin.

So as far as Doxia is concerned, I will close this issue as fixed, you may open another feature request for the site renderer or site plugin.

Show
Lukas Theussl added a comment - I don't think the TOC macro was meant to provide this functionality. It was designed to work within single pages, not whole sites (DOXIA-40). What you want should rather be accomplished by some outside plugin, like the site plugin does with site.xml, and I am currently thinking about the same functionality for the pdf plugin. So as far as Doxia is concerned, I will close this issue as fixed, you may open another feature request for the site renderer or site plugin.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: