Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure vignette toc depth #821

Merged
merged 1 commit into from
Oct 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# pkgdown 1.1.0.9000

* The display depth of vignette tables of contents can be configured by setting `toc: depth` in `_pkgdown.yml`:

```yaml
toc:
depth: 2
```

* `build_site()` now uses colors even if `new_process = TRUE` (@jimhester).

* `deploy_site_github()` added to build and deploy a site to GitHub Pages from the
Expand Down
10 changes: 9 additions & 1 deletion R/build-articles.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@
#' to enable rendering of [bookdown](https://bookdown.org/yihui/bookdown/)
#' sites.
#'
#' @section Tables of contents:
#' You can control the TOC depth via the YAML configuration file:
#'
#' ```
#' toc:
#' depth: 2
#' ```
#'
#' @inheritParams as_pkgdown
#' @param quiet Set to `FALSE` to display output of knitr and
#' pandoc. This is useful when debugging.
Expand Down Expand Up @@ -215,7 +223,7 @@ build_rmarkdown_format <- function(pkg,

out <- rmarkdown::html_document(
toc = toc,
toc_depth = 2,
toc_depth = pkg$meta$toc$depth %||% 2,
self_contained = FALSE,
theme = NULL,
template = template$path
Expand Down
7 changes: 7 additions & 0 deletions man/build_articles.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.