After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748456 - xsl: Enable ToC generation on empty <toc/> elements
xsl: Enable ToC generation on empty <toc/> elements
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: 1.22
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-25 16:06 UTC by Emanuele Aina
Modified: 2015-04-28 08:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xsl: Enable ToC generation on empty <toc/> elements (1.33 KB, patch)
2015-04-25 16:06 UTC, Emanuele Aina
committed Details | Review
xsl: Enable ToC generation on empty <toc/> elements (1.33 KB, patch)
2015-04-27 19:43 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review
xsl: work around a missing mode in the xsl template (1.24 KB, patch)
2015-04-27 19:44 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Emanuele Aina 2015-04-25 16:06:49 UTC
When a section grows longer, it may be useful to include a table of
content at the top.

By processing empty <toc/> elements to automatically generate a proper table of
contents we let authors to customize the behaviour case-by-case.
Comment 1 Emanuele Aina 2015-04-25 16:06:53 UTC
Created attachment 302346 [details] [review]
xsl: Enable ToC generation on empty <toc/> elements

When a section grows longer, it may be useful to include a table of
content at the top. By processing empty <toc/> elements to automatically
generate a proper table of contents we let authors to customize the
behaviour case-by-case.
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2015-04-25 18:14:24 UTC
Do you have an example how this looks like?
Comment 3 Emanuele Aina 2015-04-26 09:24:31 UTC
At http://people.collabora.com/~em/gst-validate/html/command-line-tools.html I've uploaded a copy of the page I'm currently working on and that triggered my patch: by adding an empty <toc/> element after the title I got a nice outline of the subsections in the document.

The current page emulates something similar with a hand-coded <synopsis> element, which is really ugly, semantically and aesthetically: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-validate/html/command-line-tools.html
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2015-04-26 10:39:50 UTC
Aha, so this is for manualy written content, right? I personally think it'd be better to have one page for each tool. As a bonus gtk-doc can then generate the man pages for you.
Here is an example where I am doing this:
https://github.com/Buzztrax/buzztrax/tree/master/docs/reference/bt-cmd
Comment 5 Emanuele Aina 2015-04-27 08:59:04 UTC
Fair enough, I'll WONTFIX this myself. :)

Thanks for the pointer!
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2015-04-27 11:58:10 UTC
Hej, I am still considering it, just wanted to understand the usecase. It might be useful for long manually written sections and I don't think it hurts anything else.
I'll play with it tonight.
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2015-04-27 19:43:47 UTC
The following fixes have been pushed:
b756620 xsl: Enable ToC generation on empty <toc/> elements
1a252b0 xsl: work around a missing mode in the xsl template
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2015-04-27 19:43:55 UTC
Created attachment 302479 [details] [review]
xsl: Enable ToC generation on empty <toc/> elements

When a section grows longer, it may be useful to include a table of
content at the top. By processing empty <toc/> elements to automatically
generate a proper table of contents we let authors to customize the
behaviour case-by-case.
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2015-04-27 19:44:01 UTC
Created attachment 302480 [details] [review]
xsl: work around a missing mode in the xsl template

Fixes #729911
Comment 10 Stefan Sauer (gstreamer, gtkdoc dev) 2015-04-27 20:40:54 UTC
Ignore the
1a252b0 xsl: work around a missing mode in the xsl template
one. Thats not related to this bug.
Comment 11 Emanuele Aina 2015-04-28 08:00:47 UTC
Thanks!