On Håkon’s suggestion, here I am asking about an issue I’m having with JavaScript-generated table of contents.
Basically, I’m trying to reproduce the Oliver Twist example by splitting it up into different chunks (my ultimate aim is to replace these chunks with URLs and be able to “print on demand” portions of a website with an automatically generated TOC).
I use XInclude directives in a wrapper XML file to include the [UTF-8/XHTML version of the] different chunks (say, oliver-toc.html, oliver-1.html, oliver-2.html [first two chapters only, to reduce processing time]) after putting the CSS and JS into two separate files (of course, I need to remove the onload attribute from the body tag(s) and add window.onload = maketoc at the end of the JS file). I then call Prince like so:
To my greatest amazement, this almost works!
The TOC gets generated with all the correct link texts and page references, but inactive hyperlinks.
Any advice on this would be greatly appreciated. :mrgreen:
Basically, I’m trying to reproduce the Oliver Twist example by splitting it up into different chunks (my ultimate aim is to replace these chunks with URLs and be able to “print on demand” portions of a website with an automatically generated TOC).
I use XInclude directives in a wrapper XML file to include the [UTF-8/XHTML version of the] different chunks (say, oliver-toc.html, oliver-1.html, oliver-2.html [first two chapters only, to reduce processing time]) after putting the CSS and JS into two separate files (of course, I need to remove the onload attribute from the body tag(s) and add window.onload = maketoc at the end of the JS file). I then call Prince like so:
prince -s oliver.css --script=oliver.js oliver-wrapper.xml -o oliver-twist.pdf
(Test files attached below).To my greatest amazement, this almost works!
![:D](/forum/static/smiley/bigsmileface.png)
Any advice on this would be greatly appreciated. :mrgreen: