- From: Håkon Wium Lie <howcome@opera.com>
- Date: Tue, 28 Jan 2014 01:23:21 +0100
- To: François REMY <francois.remy.dev@outlook.com>
- Cc: "'Bjoern Hoehrmann'" <derhoermi@gmx.net>, "'Daniel Glazman'" <daniel.glazman@disruptive-innovations.com>, <www-style@w3.org>
François REMY wrote:
> ± Users of dead tree media might not mind ToCs that allow no interaction, but
> ± it seems clear everybody else would want links to be clickable and to be
> ± guaranteed to lead to the correct section.
> What are we talking about here? My demo *has* clickable links.
> http://fremycompany.com/TEMP/2014-01/demo-regions-toc.html (I had
Yes, your demo has clickable links, but only because you wrote those
links into the HTML code.
If you want to automate the creation of ToCs, you will need to
automate the creation of links as well. GCPM tried to do
it at some point:
http://www.w3.org/TR/2007/WD-css3-gcpm-20070504/#toc
I have since concluded that this is beyond what a declarative language
like CSS should be made to do.
JavaScript, however, offers a reasonable solution to the ToC problem.
Here's an HTML document with a toc-generating script, along with a PDF
rendition:
http://www.princexml.com/howcome/2011/oliver-twist/oliver-twist.html
http://www.princexml.com/howcome/2011/oliver-twist/oliver-twist.pdf
Creating an index is similar, but more difficult du to formatting
conventions. Here's an HTML file with the resultant PDF:
http://www.princexml.com/howcome/2011/musick/musick.html
http://www.princexml.com/howcome/2011/musick/musick.pdf
As you can see from the index in the back of the file, it misses
commas between page numbers and the collapsing of equal page numbers
into one link. To fix this, one needs to run a script both before and
after formatting.
-h&kon
Håkon Wium Lie CTO °þe®ª
howcome@opera.com http://people.opera.com/howcome
Received on Tuesday, 28 January 2014 00:24:02 UTC