I am trying to create a bookdown book and have it show up on github. However, it seems like the navigation of the bookdown book only allows for 3 levels of headers. I would like to be able to add more levels as it's extremely important for the user to be able to quickly navigate from one section to another.
What are some potential solutions to this problem? And are there any solutions in the pipeline before I start building?
I have thought about creating a nested book. Basically create a book, and then have a link in one of the pages link to another book that I create. However, there seems to be a couple issues with this. (1) I will end up with 2 index.htmls, and both will be located in the same github location. (2) I don't believe using the search of the outer book will result in results in the inner book.
Are there any other solutions for this or ideas for this? Such as make the base page NOT index.html?
The toc option controls the behavior of the table of contents (TOC). You can collapse some items initially when a page is loaded via the collapse option. Its possible values are subsection , section , none (or null ). This option can be helpful if your TOC is very long and has more than three levels of headings: subsection means collapsing all TOC items for subsections (X.X.X), section means those items for sections (X.X) so only the top-level headings are displayed initially, and none means not collapsing any items in the TOC. For those collapsed TOC items, you can toggle their visibility by clicking their parent TOC items. For example, you can click a chapter title in the TOC to show/hide its sections.
And I remember now !! You need to use the same parameter as in rmarkdown::html_document, called toc_depth because Pandoc which is generating the toc will default to three levels !!
That means you should add
gitbook:
toc_depth: 6
in the yaml header !
It is documented in the help page as ... is passed to html_document as explained, and html_document has this option !
Thanks! I'll have to take a look again. It was working for a second, and now it's not - even when I put it into _output.yml or index.Rmd. I'll have to spend time debugging when I have more time.