Put quoted inline R function in your blogdown or quarto post's YAML header to
have the packages be the packages used in your post (wrapper around
funspotr::spot_pkgs()).
Usage
spot_tags(
file_path = knitr::current_input(),
used = FALSE,
drop_knitr = FALSE,
yaml_bullet = NULL,
...
)Arguments
- file_path
Default is the file being knitted but can change to some other file (e.g. in cases where the code for the post may reside in a different file).
- used
Default is
FALSE. IfTRUEwill pass toshow_pkgs_used()rather thanshow_pkgs(). (Mainly useful for showing actual packages used rather than meta-packages being called liketidyverseortidymodels. Also uses a more strict parsing method.- drop_knitr
Many blogdown posts have
knitr::opts_chunk$set()in them and you may not want this tag showing-up. Default is to keep this, but set toFALSEto drop "knitr" from being tagged.- yaml_bullet
Default is
NULLmeaning thatfile_pathis read-in and correct format is guessed based on "spot_tags" appearance with either a hyphen or bracket (corresponding with bulleted or array format in the YAML header).If it's first occurrence happens on a line that contains a bracket the value becomes
FALSEelse it becomesTRUE. If set toNULLand "spot_tags" is not detected at all infile_pathit will default toFALSE.yaml_bulletcan also be specified directly with eitherTRUEorFALSE.TRUEentails thatspot_tags()is set in a YAML bullet,FALSEindicates the user is inputting it in an array (see examples below).See examples for how to hard-code.
- ...
Any additional arguments to pass to
spot_pkgs*().
Value
Character vector in a format meant to be read while evaluating the YAML header when rendering.
Details
tags:
- "`r funspotr::spot_tags()`"OR
tags: ["`r funspotr::spot_tags()`"]OR
categories: ["`r funspotr::spot_tags()`"]Thanks Yihui for the suggestions and for getting this working blogdown#647, blogdown#693.)
