wflow_toc creates a table of contents of the published R Markdown files. The output is in markdown format, so you can paste it into a document such as index.Rmd. If the R package clipr is installed, the table of contents is copied to the clipboard. Otherwise the output is sent to the R console.

  ignore_nav_bar = TRUE,
  clipboard = TRUE,
  only_published = TRUE,
  project = "."



logical (default: TRUE). Ignore any HTML files included as links in the navigation bar.


logical (default: TRUE) Attempt to copy table of contents to clipboard. Only relevant if clipr package is installed and the system keyboard is available.


logical (default: TRUE) Include only published contents.


character (default: ".") By default the function assumes the current working directory is within the project. If this is not true, you'll need to provide the path to the project directory.


Invisibly returns the table of contents as a character vector.


The default behavior is to attempt to copy the table of contents to the clipboard for easy pasting into an R Markdown document. If this isn't working for you, you can try the following:

  • Check that the clipr package is installed: install.packages("clipr")

  • Check that the system keyboard is writable. Run clipr_available and dr_clipr.

  • If it's still not working, set clipboard = FALSE to send the table of contents to the R console to manually copy-paste.