Forum How do I...?

Making a TOC only appear in Prince

tarquinwj
I want to allow people to use Prince to create PDFs of a Web page. An example would be this page here:
www<b></b>.<b></b>cavinguk<b></b>.<b></b>co<b></b>.<b></b>uk/info/Crescent.htm

When displayed in a browser, the CSS (screen media) displays the navigation as a list of links to the internal anchors.

The CSS also has this line to make it display as a TOC when processed by Prince:
#navig a::after { content: leader(".") target-counter(attr(href), page); }

However, no browser understands this, so they would just display a useless table with no page numbers. Obviously more of my visitors will be using a browser than prince, and I want them to be able to print the page without this useless TOC at the top. But if someone uses Prince, I want the TOC to appear, with page numbers.

At the moment, I just comment out the useful stuff, and set the navigation to display:none in print media, and tell them to uncomment the CSS if they want to use Prince. But I would like something more smart. CSS does not have any way to check for support for a feature, but I do not want to use CSS parsing hacks, so the only alternative will be to use the feature itself. So the questions:

1. Is there any way you can think of to make the TOC visible only when processed by prince, but not when printed by normal browsers? Preferably using something in the CSS 3 GC for paged media module.

2. Is there an alternative way to generate the TOC in prince that does not rely on the existing links? I tried using this, but couldn't get it to work in Prince:
www<b></b>.<b></b>w3<b></b>.<b></b>org/TR/css3-gcpm/#toc

3. Does prince have some custom CSS that would do what I want?

Thanks.
tarquinwj
Never mind, just found the Prince 6 alphas can load from HTTP, so that makes it a load more easy, as they can just specify it on the command line. Any plans to get the GUI version to be able to load files from HTTP natively? Right now it uses Windows' own support, which means Internet Explorer's HTTP handling. As a result, the stylesheets and images cannot be loaded correctly.