docs-to-pdf icon indicating copy to clipboard operation
docs-to-pdf copied to clipboard

Idea: Align headers level to the sidebar nesting, or make page level configurable by meta keywords

Open codingluke opened this issue 2 years ago • 1 comments

At the moment, when generating a PDF from a Website, every subpage starts with a <h1>. However on the Website some pages are nested under higher level pages.

For example:

  • https://docusaurus.io/docs/next/category/getting-started
  • https://docusaurus.io/docs/next/installation
  • https://docusaurus.io/docs/next/configuration

Screenshot_2023-08-16_000095

Here getting started is the entry point and has multiple subsites like "installation" and "configuration" and so on.

I question myself whether it would be great to finde out, if a page is a parent or a child and automatically change the heading level to the next, when it is a child. On installation the <h1> would become a <h2> and so on...

💡 We could also manage this with meta keywords, so it would be manual configurable per page :) Together with the bookmarks enhancement this would make it superior to word and google docs.

What do you think?

codingluke avatar Aug 16 '23 07:08 codingluke

This behavior could be activated with a --alignTOCWithSidebar option.

sboursault avatar Jul 09 '24 09:07 sboursault