Community
Participate
Working Groups
When the XML project plan is rendered to HTML, e.g. http://www.eclipse.org/projects/project-plan.php?projectid=dsdp.tm It should render a table of contents for the various headings and subheadings, along with <a name=> tags for the headings. This would allow to send hyperlinks which directly jump to a subheading by E-Mail if a particular item is to be referenced. Also, it would simplify navigating through the plan.
Dave, this seems like something the XSLT could do.
Yeah, I can take a look at it, maybe we need to revive the Plan2.php for testing purposes again. I'm in the middle of some other XSLT work right now, so might get to a POC tomorrow.
Created attachment 111866 [details] Add Table of Contents Adds a table of contents and links back to the table of contents.
bjorn, the patch attached to the message adds a div tag with an id attribute, so you can set the css as appropriate for styling the table of contents. It's pretty basic, but let me know if we need to do anything more complicated with it.
Would it be possible to get each theme listed in the TOC as well, preferrably on another level? i.e. <li><a href="#themes_and_priorities">Themes and Priorities <ul><li><a href="#tp_1">Theme 1</a></li> <li><a href="#tp_2">Theme 2</a></li> </ul></li>
Patch applied, thanks Dave. Closing as FIXED. Martin, if you'd like to provide a patch that does more, I'm happy to review and apply that one too.
(In reply to comment #5) > Would it be possible to get each theme listed in the TOC as well, preferrably > on another level? i.e. > > <li><a href="#themes_and_priorities">Themes and Priorities > <ul><li><a href="#tp_1">Theme 1</a></li> > <li><a href="#tp_2">Theme 2</a></li> > </ul></li> > It's possible...several ways to do it, there is a generate-id() function, or we add a required id attribute to the themes that need to be filled in. Using just the name attribute on the Theme won't work as it won't be a unique id. XSLT Faq shows some examples using generate-id http://www.dpawson.co.uk/xsl/sect2/N4416.html
On the TM project plan at least, the "Themes and Priorities" index in the TOC links into the "#compatibility" section... http://www.eclipse.org/projects/project-plan.php?projectid=dsdp.tm
Actually, it turns out that for dsdp.tm, the "preamble" of Themes and Priorities is completely removed when rendering... that's why the anchor is missing...
I can reproduce this locally, so I'll see about getting a patch done this morning.
Created attachment 112412 [details] Fixes issue with Themes hyperlink, as well as preamble not rendering Includes all previous patches, plus fixes hyperlink for themes and priorities as well as rendering the preamble for themes and priorities.
Patch applied, closing as FIXED.
Sorry, but the "a href" for the "themes and priorities" TOC entry is 1 off, so it cannot be navigated: http://www.eclipse.org/projects/project-plan.php?projectid=dsdp.tm The TOC has <a href="#themes_and_prioritie"> <-- NOTE THE MISSING s --> The impl has <a name="themes_and_priorities"> With respect to allowing TOC entries for individual themes: in order to avoid the "synthetically generating unique names" problem, what if the XML markup were extended to allow an optional additional user-specified attribute of each <theme> node to get used in the TOC? E.g. <p:theme name="Improve Usability" href="th1" toc="1"> Only those themes with href attribute would get an <a name> tag. Only those with toc="1" would also get listed in the TOC. Would that make sense?
(in reply to comment #13) I fixed the missing "s" problem, but leave the rest of your question to the greater expertise of Dave.
(In reply to comment #13) > With respect to allowing TOC entries for individual themes: in order to avoid > the "synthetically generating unique names" problem, what if the XML markup > were extended to allow an optional additional user-specified attribute of each > <theme> node to get used in the TOC? E.g. > > <p:theme name="Improve Usability" href="th1" toc="1"> > > Only those themes with href attribute would get an <a name> tag. Only those > with toc="1" would also get listed in the TOC. Would that make sense? Technically, you don't have to do that as XSLT has a generate-id() function that we could use. http://www.w3schools.com/XSL/func_generateid.asp So, if somebody wants to take a crack at learning some XSLT and adding this, the XSL Tools has the available editors, and a good tutorial on working with XSLT can be found here: http://www.cafeconleche.org/books/bible2/chapters/ch17.html and http://www.xfront.com/files/tutorials.html Gotta teach somebody else this XSLT stuff otherwise I'll end up maintaining this all by myself. :)
Marking this fixed sine Dave's work is done for now. I filed bug 249939 to track the additional enhancement of a TOC entry for each theme.