Repository navigation
PDF "Table of Contents" localization #11106
Replies: 1 comment 1 reply
|
There is no metadata for it. The heading is hard-coded in 1. Add a template folder to "template": ["default", "modern", "template"]2. Create /* Hide the built-in heading text but keep its box, size and spacing */
.pdftoc h1 {
position: relative;
visibility: hidden;
}
.pdftoc h1::after {
content: "Table of Contents";
position: absolute;
top: 0;
left: 0;
visibility: visible;
}
/* One heading per PDF: each TOC page only links to the articles of its own toc.yml */
.pdftoc:has(a[href*="/fi/"]) h1::after {
content: "Sisällysluettelo";
}Per PDF: CSS can't see which
What I tested (docfx 2.78.5, modern template): a site with
A real setting for the title is tracked in #10218 ("Title of TOC hardcoded as 'Table of Contents' for PDFs"). The CSS above works until that is fixed. Disclosure: I work on a hosted HTML-to-PDF API. Nothing above uses it. I wrote this with AI help and verified it by building the PDFs described. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I build a PDF and set
pdfTocPage: trueinTOC.ymlso docfx generates a page with a "Table of Contents" heading and a list of the articles. However the content is not in the English language so the English text "Table of Contents" feels out of place. Is there a way to replace that with a translation to a different language? Perhaps by using metadata or a custom template?The entire documentation set does contain articles in English too, so it would be best if the heading text and its language could be specified per PDF.
All reactions