Forum How do I...?

TOC generation for Docusarus

unspecifiedid
Greetings

I am hoping to be pointed in the direction on the following items :
- how to add a table of contents to the front of a generated pdf when using Prince with Docusaurus.
- generating page numbers or adding a footer with page numbers in it

The command I am using is:
npx docusaurus-prince-pdf -u http://localhost:3000/docs/0.9.0/website_overview --include-index --toc -o ./pdf/website_output.pdf --prince-args '\-\-javascript'

This generates a pdf creating an index that can be accessed via OSX Preview. I'm wishing though to be able to circulate a complete PDF with a generated TOC to the front of the document hopefully referencing page numbers.


Environment:
Prince 15.2 - non-commercial License
Docusaurus version: 3.1.1
Node version: v21.6.1
OSX Sonama 14.2.1

Any Help would be appreciated.

Edited by unspecifiedid

csant
Is the information provided here of any help?

As you are dealing with Docusaurus, a navigation menu at the beginning of the document is automatically generated - all you need to do is to style it (for printed media) in a way that it looks like an index.
border
Hi!

This is another developer working on this problem alongside OP, The documentation isn't quite helping, we get to the point where we can generate a full PDF of the website, and **separately** generate a table of contents, but when attempting to run the command given in the documentation, it doesn't generate the TOC, only the webpage.
Also, the TOC generated links to nothing, just gives errors when attempting to follow the links.

We want to use the inbuilt feature for the TOC within princeXML, and not the auto-generated index from docusuarus, unless there is a way to remove the cards that docusaurus uses to display the index, and format it akin to the Multi-file TOC from the princeXML documentation

Any help would be appreciated :)
ZurichKevin
Did you ever get any help?

Kevin Donovan

ZurichKevin
We have worked through the information at https://www.princexml.com/doc/cookbook/#table-of-contents but without much success. A set of links is generated but contains irrelevant strings.

Kevin Donovan