feat(pdf): Add pdfTocSource option to generate TOC from document head… - #10995
Open
tsondergaard wants to merge 1 commit into
Open
feat(pdf): Add pdfTocSource option to generate TOC from document head…#10995tsondergaard wants to merge 1 commit into
tsondergaard wants to merge 1 commit into
Conversation
Author
|
@dotnet-policy-service agree |
Author
|
@yufeih, I see in the pull request history that you are the most active reviewer recently for this repo. Could you have a look at my PR or maybe point me to another suitable reviewer? |
tsondergaard
force-pushed
the
10994-toc-from-headings
branch
from
February 21, 2026 11:07
9ff6562 to
dbee2b9
Compare
…ings Add new configuration options to control PDF Table of Contents source: - pdfTocSource: 'toc' (default) or 'headings' to extract from document content - pdfTocHeadingDepth: maximum heading level to include (1-6, default 3) When pdfTocSource is set to 'headings', the PDF TOC is generated by extracting h1-h6 headings from the rendered HTML pages instead of using the toc.yml structure. This is particularly useful for print-style publications using docfx for markdown-to-PDF generation, where the TOC should reflect the document's internal heading structure rather than website navigation. Fixes dotnet#10994
tsondergaard
force-pushed
the
10994-toc-from-headings
branch
from
February 23, 2026 17:48
dbee2b9 to
9d6134e
Compare
Author
|
Hi @tsondergaard , @yufeih, p.s. The title sequence in my screenshot is generated by vs code extension 'markdown all in one'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

…ings
Add new configuration options to control PDF Table of Contents source:
When pdfTocSource is set to 'headings', the PDF TOC is generated by extracting h1-h6 headings from the rendered HTML pages instead of using the toc.yml structure. This is particularly useful for print-style publications using docfx for markdown-to-PDF generation, where the TOC should reflect the document's internal heading structure rather than website navigation.
Fixes #10994