bookdown
bookdown copied to clipboard
TOC page
It would be useful to have complete (at least up to third level) table of contents on a single page. Would link to it from "Table of contents" in left hand sidebar, and maybe introduce it as a virtual first chapter that's linked from index?
Similar request for gitbook()
format in #967
As it won't originate from an Rmd it'd be important for its name to be very specific.
I'd like it to have a single name so that it's easy to tackle for OG/Twitter metadata. I'll pretend it's called "table-of-contents.html" in that PR, but if there's an Rmd whose title gets the same path, that path needs to be changed.
When adding the TOC it will be important to tweak the metadata description accordingly. Rough code via #1034
if (file == "table-of-contents.html") {
description_string <- if (!is.na(xml2::xml_attr(og_description, "content"))) {
paste(
"Table of contents;",
xml2::xml_attr(og_description, "content")
)
} else {
"Table of contents"
}
set_content(og_description, description_string)
set_content(general_description, description_string)
}