Very wide words are now automatically broken across lines and hyphenated (when possible) when they’d otherwise create a horizontal scrollbar on mobile (#1888).
+
+init_site() once again describes one copy per line, and now uses a better prefix when copying assets from pkgdown itself (#2445).
+
Very wide words are now automatically broken across lines and hyphenated (when possible) when they’d otherwise create a horizontal scrollbar on mobile (#1888).
The repo.source.url field no longer requires a trailing slash (#2017).
Anywhere you can use _pkgdown.yml, you can now use _pkgdown.yaml (#2244).
pkgdown no longer overrides the default selection colours. This improves accessibility for users who have set their own colours in their browser settings (#2139, @glin).
diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml
index 07b1a3a34..c790f0cb0 100644
--- a/dev/pkgdown.yml
+++ b/dev/pkgdown.yml
@@ -14,7 +14,7 @@ articles:
search: search.html
short: test/short.html
widgets: test/widgets.html
-last_built: 2024-04-23T21:55Z
+last_built: 2024-04-24T13:23Z
urls:
reference: https://pkgdown.r-lib.org/reference
article: https://pkgdown.r-lib.org/articles
diff --git a/dev/search.json b/dev/search.json
index 2a9acea93..a1b2d5b4f 100644
--- a/dev/search.json
+++ b/dev/search.json
@@ -1 +1 @@
-[{"path":"https://pkgdown.r-lib.org/dev/CODE_OF_CONDUCT.html","id":null,"dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"Contributor Code of Conduct","text":"contributors maintainers project, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. committed making participation project harassment-free experience everyone, regardless level experience, gender, gender identity expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion. Examples unacceptable behavior participants include use sexual language imagery, derogatory comments personal attacks, trolling, public private harassment, insults, unprofessional conduct. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct. Project maintainers follow Code Conduct may removed project team. Instances abusive, harassing, otherwise unacceptable behavior may reported opening issue contacting one project maintainers. Code Conduct adapted Contributor Covenant (http://contributor-covenant.org), version 1.0.0, available http://contributor-covenant.org/version/1/0/0/","code":""},{"path":"https://pkgdown.r-lib.org/dev/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to pkgdown","title":"Contributing to pkgdown","text":"document outlines propose change pkgdown. detailed info contributing tidyverse packages, please see tidyverse contribution guide.","code":""},{"path":"https://pkgdown.r-lib.org/dev/CONTRIBUTING.html","id":"pkgdown-and-pandoc-versions","dir":"","previous_headings":"","what":"pkgdown and Pandoc versions","title":"Contributing to pkgdown","text":"versions pkgdown Pandoc used build website stored public facing pkgdown.yml file, e.g. https://dplyr.tidyverse.org/pkgdown.yml.","code":""},{"path":"https://pkgdown.r-lib.org/dev/CONTRIBUTING.html","id":"package-reprexes","dir":"","previous_headings":"","what":"Package reprexes","title":"Contributing to pkgdown","text":"encounter unexpected errors running pkgdown::build_site(), try build minimal package recreates error. ideal minimal package dependencies, making easy install quickly reproduce error. example minimal package issue, minimal package containing single .R file two lines reproduce error. quickest way set minimal example package usethis::create_package(): built minimal package recreates error, create GitHub repository package (e.g. usethis::use_git() + usethis::use_github()), file issue link repository.","code":"usethis::create_package(\"~/desktop/testpackage\") # ... edit files ... pkgdown::build_site(tmp, new_process = FALSE, preview = FALSE)"},{"path":"https://pkgdown.r-lib.org/dev/CONTRIBUTING.html","id":"rd-translation","dir":"","previous_headings":"","what":"Rd translation","title":"Contributing to pkgdown","text":"encounter problems Rd tags, please use rd2html() create reprexes:","code":"library(pkgdown) rd2html(\"a\\n%b\\nc\") rd2html(\"a & b\")"},{"path":"https://pkgdown.r-lib.org/dev/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"","what":"Pull request process","title":"Contributing to pkgdown","text":"recommend create Git branch pull request (PR). Look Travis AppVeyor build status making changes. README contain badges continuous integration services used package. New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat. Contributions test cases included easier accept. user-facing changes, add bullet top NEWS.md current development version header describing changes made followed GitHub username, links relevant issue(s)/PR(s).","code":""},{"path":"https://pkgdown.r-lib.org/dev/CONTRIBUTING.html","id":"netlify","dir":"","previous_headings":"Pull request process","what":"Netlify","title":"Contributing to pkgdown","text":"might ask Netlify preview changes .e. local changes affect pkgdown website? Build install amended package, re-build website (clean_site() build_site()) update docs/ folder. Log Netlify https://app.netlify.com/sites/, scroll bottom. ’ll see box dashed outline says “Want deploy new site without connecting Git?”. Open file browser, navigate docs/, drag docs/ folder dashed box, copy files temporary netlify site. file transfer completes, netlify generate temporary URL new page can copy/paste PR discussion.","code":""},{"path":"https://pkgdown.r-lib.org/dev/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to pkgdown","text":"Small typos grammatical errors documentation may edited directly using GitHub web interface, long changes made source file. YES: edit roxygen comment .R file R/. : edit .Rd file man/.","code":""},{"path":"https://pkgdown.r-lib.org/dev/CONTRIBUTING.html","id":"prerequisites","dir":"","previous_headings":"","what":"Prerequisites","title":"Contributing to pkgdown","text":"make substantial pull request, always file issue make sure someone team agrees ’s problem. ’ve found bug, create associated issue illustrate bug minimal reprex.","code":""},{"path":"https://pkgdown.r-lib.org/dev/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to pkgdown","text":"Please note pkgdown project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://pkgdown.r-lib.org/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 pkgdown authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"getting-started","dir":"Articles","previous_headings":"","what":"Getting started","title":"Customise your site","text":"theming features work Bootstrap 5, first update site adding following lines _pkgdown.yml: Overall, site look pretty similar, notice number small improvements. importantly, default font much bigger, making considerably easier read. Upgrading Bootstrap 5 low chance breaking site unless using pkgdown templates custom CSS.","code":"template: bootstrap: 5"},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"theming","dir":"Articles","previous_headings":"","what":"Theming","title":"Customise your site","text":"two ways change visual style site _pkgdown.yml: using pre-packaged bootswatch theme customising theme variables bslib. following sections show .","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"bootswatch-themes","dir":"Articles","previous_headings":"Theming","what":"Bootswatch themes","title":"Customise your site","text":"easiest way change entire appearance website use Bootswatch theme: Changing bootswatch theme affects HTML (via navbar, ) CSS, ’ll need re-build complete site build_site() fully appreciate changes. ’re experimenting, can speed things just rebuilding home page CSS running build_home_index(); init_site() (refreshing browser). Bootswatch templates tall navbars (e.g. lux, pulse) also require set pkgdown-nav-height bslib variable. Bootswatch themes provided bslib R package, can also nest bootswatch field bslib field. can find correct height running $(\".navbar\").outerHeight() javascript console.","code":"template: bootstrap: 5 bootswatch: materia template: bootstrap: 5 bslib: bootswatch: lux pkgdown-nav-height: 100px"},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"bslib-variables","dir":"Articles","previous_headings":"Theming","what":"bslib variables","title":"Customise your site","text":"Instead picking complete theme, can tweak fonts colours individually using bslib variables. bslib R package wraps sass, tool Boostrap uses produce CSS special language called scss. primary advantage scss CSS ’s programmable, can key bslib variables affect appearance many HTML elements. three key variables affect colour: bg (background) determines page background. fg (foreground) determines text colour. bg fg mixed yield gray-100, gray-200, …, grey-900, used style elements match overall colour scheme. primary sets link colour (translucent) hover colour navbar sidebar. can customise components setting specific bslib variables, taking advantage inheritance possible. example, table-border-color defaults border-color defaults gray-300. want change colour borders, can set border-color; just want change colour table borders, can set table-border-color. can find full list variables vignette(\"bs5-variables\", package = \"bslib\"). Theming bslib powered bslib::bs_theme() bslib field direct translation arguments function. result, can fully specify bslib theme using template.bslib field, making easy share YAML output.html_document.theme field R Markdown document. iterating colours variables need rerun init_site() refresh browser see changes.","code":"template: bootstrap: 5 bslib: bg: \"#202123\" fg: \"#B8BCC2\" primary: \"#306cc9\" template: bslib: version: 5 bg: \"#202123\" fg: \"#B8BCC2\" primary: \"#306cc9\""},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"fonts","dir":"Articles","previous_headings":"Theming","what":"Fonts","title":"Customise your site","text":"can also override default fonts used majority text (base_font), headings (heading_font) code (code_font). easiest way supply name Google font following syntax: want use non-Google font, ’ll need bit work. two steps: need first configure font CSS use _pkgdown.yml. two ways might get CSS: block CSS put pkgdown/extra.scss pkgdown/extra.css. CSS look something like : link style file, ’ll need add using syntax: _pkgdown.yml can use name font just specified: Depending font (paid money ), may need take additional steps ensure can used site, /make sure can still used ’re previewing locally. ’re problems getting custom font work, looking errors browser developer console good place start. iterating fonts, ’ll need run build_home_index(); init_site() refresh browser see update.","code":"template: bootstrap: 5 bslib: base_font: {google: \"Roboto\"} heading_font: {google: \"Roboto Slab\"} code_font: {google: \"JetBrains Mono\"} @font-face { font-family: \"proxima-nova\"; src: local(\"Proxima Nova Regular\"), local(\"ProximaNova-Regular\"), url(\"https://example.com/ProximaNova-Regular.eot?#iefix\") format(\"embedded-opentype\"), url(\"https://example.com/fonts/proxima/ProximaNova-Regular.woff2\") format(\"woff2\"), url(\"https://example.com/fonts/proxima/ProximaNova-Regular.woff\") format(\"woff\"), url(\"https://example.com/fonts/proxima/ProximaNova-Regular.ttf\") format(\"truetype\"); font-weight: normal; font-style: normal; font-display: fallback; } template: includes: in_header: template: bslib: base_font: proxima-nova"},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"syntax-highlighting","dir":"Articles","previous_headings":"Theming","what":"Syntax highlighting","title":"Customise your site","text":"colours used syntax highlighting code blocks controlled theme setting: can choose following options: a11y-dark, a11y-light, arrow-dark, arrow-light, atom-one-dark, atom-one-light, ayu-dark, ayu-light, ayu-mirage, breeze-dark, breeze-light, breezedark, dracula, espresso, github-dark, github-light, gruvbox-dark, gruvbox-light, haddock, kate, monochrome-dark, monochrome-light, monochrome, monokai, nord, oblivion, printing, pygments, radical, solarized-dark, solarized-light, solarized, tango, vim-dark, zenburn. Bootswatch themes dark background (e.g. cyborg, darkly, solar) need dark syntax highlighting theme, e.g. arrow-dark: foreground background colours used inline code controlled code-color code-bg bslib variables. want inline code match code blocks, ’ll need override variables , e.g.:","code":"template: bootstrap: 5 theme: breeze-light template: bootstrap: 5 bootswatch: cyborg theme: arrow-dark template: bootstrap: 5 theme: arrow-dark bslib: code-bg: \"#2b2b2b\""},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"navbar-style","dir":"Articles","previous_headings":"Theming","what":"Navbar style","title":"Customise your site","text":"primary navbar colours determined HTML classes, CSS, can customized using navbar fields bg type control background foreground colours respectively. Typically bg one light, dark, primary: generally don’t need set bg use bootswatch theme, pkgdown pick bg used Bootstwatch preview. Similarly, don’t usually need set type bootstrap guess . guesses wrong, override type: light type: dark depending whether background colour light (need dark text) type: dark background dark (need light text). Unfortunately, defined relative page background, dark site ’ll need flip light dark (little experimentation quickly determine looks best). navbar styled HTML, ’ll need build_home_index(); init_site() see effect changing parameter.","code":"navbar: bg: primary"},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"layout","dir":"Articles","previous_headings":"","what":"Layout","title":"Customise your site","text":"can customise contents navbar, footer, using navbar footer fields. See ?build_home customise sidebar homepage. use similar structure separately defines overall structure individual components.","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"navbar-heading","dir":"Articles","previous_headings":"Layout","what":"Navbar","title":"Customise your site","text":"can customise navigation bar appears top page navbar field. ’s made two pieces: structure, defines overall layout, components, defines piece looks like. organisation makes easy mix match pkgdown defaults customisations. default structure: makes use six built-components: intro: “Get Started”, links vignette article name package1. reference, .Rd files. articles, vignettes articles. tutorials, tutorials. news, NEWS.md exists. search, search box (see vignette(\"search\") details). github, link source repository (icon), can automatically determined DESCRIPTION. can use structure field reorganise navbar without changing default contents: can use components override default content. example, yaml provides custom articles menu: Components uses syntax RMarkdown menus. elements menu can : link (text + href) heading (just text) separator (text: ——–) Instead text, can also use name icons fontawesome. also provide textual description aria-label field screenreader users. add new component navbar, need modify structure components. example, following yaml adds new “twitter” component appears left github icon. Finally, can add arbitrary HTML three locations navbar: includes appear screen sizes, collapsed navbar drop . can also customise colour scheme navbar using type bg parameters. See details.","code":"navbar: structure: left: [intro, reference, articles, tutorials, news] right: [search, github] navbar: structure: left: [search] right: [reference, articles] navbar: components: articles: text: Articles menu: - text: Category A - text: Title A1 href: articles/a1.html - text: Title A2 href: articles/a2.html - text: ------- - text: \"Category B\" - text: Article B1 href: articles/b1.html navbar: structure: right: [twitter, github] components: twitter: icon: fa-twitter href: http://twitter.com/hadleywickham aria-label: Twitter template: includes: before_title: after_navbar: "},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"footer","dir":"Articles","previous_headings":"Layout","what":"Footer","title":"Customise your site","text":"can customise footer footer field. ’s made two pieces: structure, defines overall layout, components, defines piece looks like. organisation makes easy mix match pkgdown defaults customisations. default structure: uses two three built-components: developed_by, sentence describing main authors package. (See ?build_home want tweak authors appear footer.) built_with, sentence advertising pkgdown. package, name package. can override defaults footer field. example puts authors’ information right along legal disclaimer, puts pkgdown link left. side pasted single string (separated \" \") converted markdown HTML.","code":"footer: structure: left: developed_by right: built_with footer: structure: left: pkgdown right: [developed_by, legal] components: legal: Provided without **any warranty**."},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"additional-html-and-files","dir":"Articles","previous_headings":"","what":"Additional HTML and files","title":"Customise your site","text":"need include additional HTML, can add following locations: can include additional files putting right place: pkgdown/extra.css pkgdown/extra.js copied rendered site linked (pkgdown defaults). pkgdown/extra.scss added scss ruleset used generate site CSS. files pkgdown/assets copied website root directory. expert users: template files pkgdown/templates override layout templates provided pkgdown template packages. Use init_site() update rendered website making changes files.","code":"template: includes: in_header: before_body: after_body: before_title: after_navbar: "},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"template-packages","dir":"Articles","previous_headings":"","what":"Template packages","title":"Customise your site","text":"share pkgdown style across several packages, best workflow create… package! can contain following: configuration file inst/pkgdown/_pkgdown.yml. can used set (e.g.) author definitions, Bootstrap version variables, sidebar, footer, navbar, etc. Templates inst/pkgdown/templates/ override default templates. Assets inst/pkgdown/assets/ copied destination directory. (Note files copied; ’ll need reference stylesheet elsewhere order actually used.) inst/pkgdown/extra.scss added bslib ruleset. (Note extra.css supported templates.) pkgdown defaults overriden template files, turn overridden package specific settings. created template package theverybest, need set site’s theme: also need make sure ’s available site build. Typically, won’t want publish package CRAN, want publish GitHub. ’ve done , assuming ’re using usethis workflow, add following line DESCRIPTION: ensure GitHub action automatically install GitHub building pkgdown site. get sense theming package works, can look : tidytemplate used tidyverse tidymodels packages; quillt used R Markdown packages; rotemplate used rOpenSci packages. please note templates aren’t suitable use package ’re designed give common visual identity specific family packages.","code":"template: package: theverybest Config/Needs/website: myorg/theverybest"},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"porting-a-template-package","dir":"Articles","previous_headings":"Template packages","what":"Porting a template package","title":"Customise your site","text":"updating template package works pkgdown 1.0.0, create directories inst/pkgdown/BS5/templates inst/pkgdown/BS5/assets (don’t templates/assets make sure add dummy file ensure git tracks ). templates assets directories directly inst/pkgdown used pkgdown 1.0.0 pkgdown 2.0.0 boostrap: 3. directories inst/pkgdown/BS5/ used pkgdown 2.0.0 boostrap: 5. lets package support versions bootstrap pkgdown.","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"pr-previews","dir":"Articles","previous_headings":"","what":"PR previews","title":"Customise your site","text":"Lastly, might useful get preview website internal pull requests. , use Netlify GitHub Actions (apply similar logic toolset): Create new Netlify website (either scratch dragging dropping simple index.html, creating site GitHub repository unlinking repository); site settings get ID saved NETLIFY_SITE_ID repo secrets; account developer settings get token saved NETLIFY_AUTH_TOKEN repo secrets. Starting standard pkgdown workflow usethis::use_github_action(\"pkgdown\"), add logic build site deploy Netlify pull requests inside repository, pull requests forks. Example workflow.","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/customise.html","id":"conclusion","dir":"Articles","previous_headings":"","what":"Conclusion","title":"Customise your site","text":"vignette explained change theming layout pkgdown websites. work improve user experience involve: Working article (?build_articles) reference indexes (?build_reference). Writing compelling README explains package cool/useful/fun. Improving contents individual articles reference topics 😉.","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html","id":"process","dir":"Articles","previous_headings":"","what":"Process","title":"How to update a released site","text":"’re speed basic idea just want code follow, . Otherwise, read .","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html","id":"setup","dir":"Articles","previous_headings":"Process","what":"Setup","title":"How to update a released site","text":"First, make sure ’re main branch, latest version: Next figure released version ’re updating: ’ll use create checkout branch ’ll work :","code":"gert::git_branch_checkout(\"main\") gert::git_pull() ver <- desc::desc_get_version()[1, 1:3] gert::git_branch_create(paste0(\"pkgdown-v\", ver), paste0(\"v\", ver))"},{"path":"https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html","id":"backport-changes","dir":"Articles","previous_headings":"Process","what":"Backport changes","title":"How to update a released site","text":"Now need backport changes dev site branch. Run R code generate git code pull changes common locations: backport DESCRIPTION, ’ll also need undo change Version: Now build site locally check looks expect:","code":"files <- c( # overall site config \"_pkgdown.yml\", # the workflow that builds the site \".github/workflows/pkgdown.yaml\", # readme and vignettes \"README.md\", \"vignettes\", # logo and favicon \"man/figures/\", \"pkgdown/\", # Author metadata and Config/Needs/Website \"DESCRIPTION\" ) glue::glue(\"git checkout v{ver} -- {files}\") desc::desc_set_version(ver) pkgdown::build_site()"},{"path":"https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html","id":"publish","dir":"Articles","previous_headings":"Process","what":"Publish","title":"How to update a released site","text":"Now need publish site. First push branch GitHub: trigger pkgdown workflow: Go package’s GHA page, e.g. usethis::browse_github_actions()). Select pkgdown workflow. Click Run workflow select branch just pushed. ’s dropdown menu , means pkgdown workflow config current.","code":"usethis:::git_push_first()"},{"path":"https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html","id":"context","dir":"Articles","previous_headings":"","what":"Context","title":"How to update a released site","text":"talk update released site, first establish might need . released site? kind pkgdown site ? updating released site take special effort?","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html","id":"automatic-development-mode","dir":"Articles","previous_headings":"Context","what":"Automatic development mode","title":"How to update a released site","text":"Every pkgdown site -called development mode, can specified via development field _pkgdown.yml. unspecified, default mode: release, results single pkgdown site. Despite name, single site reflects “current package state”, either released state development state. packages substantial user base, recommended instead specify mode: auto like : directs pkgdown “generate different sites development released versions package.” readr package demonstrates happens automatic development mode: readr.tidyverse.org documents released version, .e. install.packages() deliver.readr.tidyverse.org/dev/ documents dev version, .e. ’d get installing GitHub. mode, pkgdown::build_site(), consults DESCRIPTION learn package’s version number. development version number, rendered site written docs/dev/. released version number, site written docs/. (also signals alert users reading documentation dev version vs. released version.) Automatic development mode recommended packages broad user base, maximizes chance user read web-based documentation reflects package version locally installed.","code":"development: mode: auto"},{"path":"https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html","id":"publishing","dir":"Articles","previous_headings":"Context","what":"Publishing","title":"How to update a released site","text":"Now ’ve established meaning released (vs dev) site, consider site built (.e. HTML generated) deployed (.e. HTML published website people can see .). recommend usethis::use_pkgdown_github_pages() basic pkgdown setup configure GitHub Actions (GHA) workflow automatically render publish site GitHub Pages. function bascially shortcut calling following functions individually: use_pkgdown() use_github_pages() use_github_action(\"pkgdown\") adds pkgdown site’s URL _pkgdown.yml, URL field DESCRIPTION, GitHub repo. result, publishing cadence many pkgdown sites governed workflow maintained r-lib/actions/examples/pkgdown.yaml. (confuse _pkgdown.yml, gives instructions pkgdown package, .github/workflows/pkgdown.yaml, gives instructions GHA.) important bits GHA workflow config: Altogether means : Build deploy pushes main. Build, don’t deploy, pull requests main. reveals pkgdown errors, ensures live site isn’t updated pull request merged (code pushed main). Build deploy publish GitHub release. convention, assume GitHub release coincides CRAN release. primary mechanism building released pkgdown site. pkgdown::build_site_github_pages() consults version DESCRIPTION detect whether ’s building released version dev version. determines dest_dir, e.g. docs/ released docs/dev/ dev. package automatic development mode, means almost pushes trigger update dev site. released site updated push state non-development version number publish GitHub release. tweak things released site releases? brings us workflow_dispatch:. (Yes dangling colon correct.) inclusion workflow_dispatch trigger means pkgdown workflow can run demand, importantly browser.","code":"on: push: branches: [main, master] pull_request: branches: [main, master] release: types: [published] workflow_dispatch: - name: Build site run: Rscript -e 'pkgdown::build_site_github_pages(...)' - name: Deploy to GitHub pages 🚀 if: github.event_name != 'pull_request' uses: JamesIves/github-pages-deploy-action@4.1.4 "},{"path":"https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html","id":"construct-a-branch-for-the-update","dir":"Articles","previous_headings":"","what":"Construct a branch for the update","title":"How to update a released site","text":"overall goal create branch combines features released website (e.g. released version) development version (e.g. improvements _pkgdown.yml). easiest way start branch using latest release tag, bring selected changes files development version. example, readr’s latest release 2.1.1: general pattern: Now port innovations development site want apply released site. Files must update: .github/workflows/pkgdown.yaml _pkgdown.yml Config/Needs/website field DESCRIPTION (, probably, field! particular, mess version number.) likely candidates: README.Rmd + README.md, e.g., ’ve updated badges. documentation fixes apply released version. reason touch anything R/ even affect roxygen comments. Don’t forget document() ! new vignettes articles apply released version. tips backporting specific changes branch. lucky, specific commits default branch contain necessary changes. case, can cherry pick commit SHA: doesn’t cover everything, file want update, identify Git reference (meaning: SHA, tag, branch) file desired state. Checkout specific file path specific ref: example, readr recently gained new vignette applies released version readr, .e. document dev-features functions. can bring current branch : Commit push new branch GitHub. usethis::pr_push() can handy . Just don’t bother opening pull request (branch still pushed). Now use workflow_dispatch GHA trigger: Go Actions page repo, maybe via usethis::browse_github_actions(). Click pkgdown workflow. Click “Run workflow”. “Use workflow ” dropdown menu, select branch ’ve just made pushed, click “Run workflow”. kick pkgdown build--deploy , specifically, cause updates released site. can keep branch around , case didn’t get everything right first time things crop ’d like backport released site, next CRAN release.","code":"git checkout -b update-pkgdown-2-1-1 v2.1.1 git checkout -b NEW-BRANCH-NAME NAME-OF-RELEASE-TAG git cherry-pick SHA git checkout main -- path/to/the/file git checkout main -- vignettes/column-types.Rmd"},{"path":"https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html","id":"problem-solving","dir":"Articles","previous_headings":"","what":"Problem-solving","title":"How to update a released site","text":"Another great problem solving technique get bunch people’s _pkgdown.yml files front eyeballs. two ways : GitHub search Michael Chirico’s r-ci-samples repo. given _pkgdown.yml file, remember History Blame can helpful seeing evolved time.","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/linking.html","id":"within-a-package","dir":"Articles","previous_headings":"","what":"Within a package","title":"Auto-linking","text":"pkgdown automatically link documentation articles wherever ’s possible unambiguously. includes: Bare function calls, like build_site(). Calls ?, like ?build_site package?pkgdown. Calls help(), like help(\"pkgdown\"). Calls vignette(), like vignette(\"pkgdown\").","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/linking.html","id":"across-packages","dir":"Articles","previous_headings":"","what":"Across packages","title":"Auto-linking","text":"Linking documentation another package straightforward. Just adapt call usual way: purrr::map(), MASS::addterm(). ?purrr::map, ?MASS::addterm. vignette(\"-langs\", package = \"purrr\"), vignette(\"longintro\", package = \"rpart\") purrr pkgdown can find pkgdown site remote package, link ; otherwise, link https://rdrr.io/ documentation CRAN vignettes. order pkgdown site findable, needs listed two places: URL field DESCRIPTION, dplyr: url field _pkgdown.yml, dplyr field defined, pkgdown generate public facing pkgdown.yml file provides metadata site: Now, build pkgdown site package links dplyr documentation (e.g., dplyr::mutate()), pkgdown looks first dplyr’s DESCRIPTION find website, looks pkgdown.yml, uses metadata generate correct links. allow package linked locally installed packages, even website reachable build time, following option needs set _pkgdown.yml: allows locally installed packages access package index metadata locally installed copy, may useful website require auth, build behind firewall.","code":"URL: https://dplyr.tidyverse.org, https://github.com/tidyverse/dplyr url: https://dplyr.tidyverse.org pandoc: '2.2' pkgdown: 1.3.0 pkgdown_sha: ~ articles: compatibility: compatibility.html dplyr: dplyr.html dplyr_0.8.0: future/dplyr_0.8.0.html dplyr_0.8.0_new_hybrid: future/dplyr_0.8.0_new_hybrid.html programming: programming.html two-table: two-table.html window-functions: window-functions.html urls: reference: https://dplyr.tidyverse.org/reference article: https://dplyr.tidyverse.org/articles deploy: install_metadata: true"},{"path":"https://pkgdown.r-lib.org/dev/articles/metadata.html","id":"necessary-configuration","dir":"Articles","previous_headings":"","what":"Necessary configuration","title":"Metadata","text":"Metadata can produced correctly pkgdown website URL indicated configuration file.","code":"url: https://example.com"},{"path":"https://pkgdown.r-lib.org/dev/articles/metadata.html","id":"site-wide-customization","dir":"Articles","previous_headings":"","what":"Site-wide customization","title":"Metadata","text":"Metadata entire pkgdown website can specified site’s _pkgdown.yml configuration file home template: opengraph sections: home: title home: description fields override Title Description fields package DESCRIPTION. ’s good practice set fields make package documentation easier find via search, rather sticking title description needed CRAN. template: opengraph section allows customize social media card. image: default, pkgdown uses package’s logo card image (one exists). Use image specify alternative image social media cards pages pkgdown site. src: fully qualified URL media card image e.g. src: https://avatars.githubusercontent.com/u/22618716?v=4; relative path image rendered website e.g. src: articles/test/image.jpg; relative path image stored man/figures package e.g. src: man/figures/cards.png. src field required image specified. alt: Alternative text describing image screen readers situations social media card image displayed. twitter: can specify Twitter accounts associated package style social media card Twitter display. creator: Typically, Twitter handle author package article. site: Twitter handle organization affiliated package author sponsoring package development. one creator site included, provided value used fields. card: style social media card Twitter display. pkgdown sites, relevant options summary_large_image, featuring large image page title description, summary, featuring small square image inline left page title description.","code":"home: title: An R package for pool-noodle discovery description: Discover and add pool-noodles to your growing collection. template: opengraph: image: src: man/figures/card.png alt: \"Pool noodles configured to form the word poolnoodlr\" twitter: creator: \"@hadleywickham\" site: \"@rstudio\" card: summary_large_image"},{"path":"https://pkgdown.r-lib.org/dev/articles/metadata.html","id":"article-metadata","dir":"Articles","previous_headings":"","what":"Article metadata","title":"Metadata","text":"Articles vignettes rendered articles pkgdown can individually customized metadata social media cards. Use title, description, author fields specify title, description, (optional) author vignette article. title field used title article pkgdown site always included. title description used pkgdown page’s social media card. description included article’s YAML front matter, name package used instead. description also displayed articles index. author field used text vignette article. author name displayed depends output format. articles, opengraph section works way site-wide template: opengraph settings, applied article vignette. allows specify social media card preview images individual articles, associate article particular Twitter account. specified, opengraph settings site-wide configuration used.","code":"title: \"Introduction to poolnoodlr\" description: \"A brief introduction to pool noodles in R.\" author: \"Mara Averick\" opengraph: image: src: \"https://example.com/pkg/batpig.png\" twitter: card: summary creator: \"@dataandme\" output: rmarkdown::html_vignette vignette: > %\\VignetteIndexEntry{Introduction to poolnoodlr} %\\VignetteEngine{knitr::rmarkdown} %\\VignetteEncoding{UTF-8}"},{"path":"https://pkgdown.r-lib.org/dev/articles/pkgdown.html","id":"metadata","dir":"Articles","previous_headings":"","what":"Metadata","title":"Introduction to pkgdown","text":"can override pkgdown’s defaults YAML file called _pkgdown.yml1. important field url, gives final location site: url used throughout site generate absolute urls needed. url also part enables auto-links help topics vignettes sites external package, pkgdown sites Quarto websites. See vignette(\"linking\") . Another important option template, allows control overall appearance site: can learn controlling appearance site vignette(\"customise\").","code":"url: https://pkgdown.r-lib.org template: bootstrap: 5 bootswatch: cerulean"},{"path":"https://pkgdown.r-lib.org/dev/articles/pkgdown.html","id":"language","dir":"Articles","previous_headings":"Metadata","what":"Language","title":"Introduction to pkgdown","text":"documentation (.Rd .Rmd) written language English, declare setting setting lang two letter language code language: used set language web page translate English words pkgdown generates site. Current available translations : ca: Catalan de: German dk: Danish es: Spanish fr: French ko: Korean pt: Portuguese tr: Turkish zh_CN: Chinese (simplified)","code":"lang: fr"},{"path":"https://pkgdown.r-lib.org/dev/articles/pkgdown.html","id":"home-page","dir":"Articles","previous_headings":"","what":"Home page","title":"Introduction to pkgdown","text":"contents home page automatically generated index.md README.md. pkgdown tries order, ’s possible different display GitHub pkgdown providing files. homepage also includes sidebar full useful links; see ?build_home generated can customise .","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/pkgdown.html","id":"reference","dir":"Articles","previous_headings":"","what":"Reference","title":"Introduction to pkgdown","text":"pkgdown creates function reference reference/ includes one page .Rd help topic man/. translation individual help topics Rd HTML generally straightforward, couple things bear mind: pkgdown best autolink references help topics articles described vignette(\"linking\"). pkgdown executes examples, inserting rendered results generated HTML files. default, pkgdown generates reference index just alphabetically-ordered list functions. index much useful human curation functions can grouped described categories. override default, provide reference field _pkgdown.yml. entry reference can take one three forms: title, defined title optional desc (description) fields. subtitle, defined subtitle optional desc (description) fields. list topics defined contents field. Note use starts_with() select functions common prefix. can also use ends_with() matches(). See complete details ?build_reference. iterating reference index might want run pkgdown::build_reference_index(). just re-builds index page, making faster quickly change _pkgdown.yml see affects site.","code":"reference: - title: \"Connecting to Spark\" desc: > Functions for installing Spark components and managing connections to Spark contents: - spark_config - spark_connect - spark_disconnect - spark_install - spark_log - title: \"Reading and Writing Data\" desc: \"Functions for reading and writing Spark DataFrames.\" contents: - starts_with(\"spark_read\") - starts_with(\"spark_write\") - matches(\"saveload\")"},{"path":"https://pkgdown.r-lib.org/dev/articles/pkgdown.html","id":"articles","dir":"Articles","previous_headings":"","what":"Articles","title":"Introduction to pkgdown","text":"pkgdown automatically build vignettes found vignettes/, translating HTML files articles/. Due way pkgdown integrate RMarkdown generated HTML HTML, relatively little control available output format. can see details ?build_articles. want include article website package (e.g., ’s large), can either place subdirectory vignettes/ (e.g. vignettes/web_only) add .Rbuildignore (make sure ’s vignettes: section yaml header). extreme case want produce articles vignettes, add complete vignettes/ directory .Rbuildignore ensure DESCRIPTION VignetteBuilder field.","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/pkgdown.html","id":"news","dir":"Articles","previous_headings":"","what":"News","title":"Introduction to pkgdown","text":"NEWS.md present, rendered single-page changelog based markdown level headings. pkgdown assumes NEWS.md formatted using level one headings (#) specify package name version number, level two headings (##) provide topical organization release. See suggestions writing news bullets tidyverse style guide. See ?build_news customisation options including : Create one page major version related minor versions. Add release announcements news navbar drop-.","code":"# pkgdown 1.1.0 ## Bug Fixes * Lots of them # pkgdown 1.0.0 * This is the first release of pkgdown."},{"path":"https://pkgdown.r-lib.org/dev/articles/pkgdown.html","id":"publishing","dir":"Articles","previous_headings":"","what":"Publishing","title":"Introduction to pkgdown","text":"use GitHub, two ways publish site GitHub Pages: Build site locally, check docs directory, configure GitHub Pages use directory. Use GitHub actions automatically build publish site every time make change. easiest way set run usethis::use_pkgdown_github_pages().","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/pkgdown.html","id":"promoting","dir":"Articles","previous_headings":"","what":"Promoting","title":"Introduction to pkgdown","text":"finalized site built published web, publicize URL places: URL field package DESCRIPTION, alongside link source: (usethis::use_pkgdown_github_pages() .) repository description GitHub. (usethis::use_pkgdown_github_pages() .) Twitter (make sure include #rstats).","code":"URL: https://pkgdown.r-lib.org, https://github.com/r-lib/pkgdown"},{"path":"https://pkgdown.r-lib.org/dev/articles/search.html","id":"bootstrap-5-built-in-search","dir":"Articles","previous_headings":"","what":"Bootstrap 5: built-in search","title":"Search","text":"BS5, search built-building pkgdown website automatically build search index ’s available navbar (using fuse.js). Currently available customisation excluding paths search index: Note search requires “real” server, local file:// based preview, search won’t work default preview. test search local preview, ’ll need use servr::httw(\"docs\") similar.","code":"search: exclude: ['news/index.html']"},{"path":"https://pkgdown.r-lib.org/dev/articles/search.html","id":"bootstrap-3-algolia","dir":"Articles","previous_headings":"","what":"Bootstrap 3: Algolia","title":"Search","text":"pkgdown websites can integrate search capability using DocSearch Algolia. DocSearch powerful search engine free documentation websites. two steps needed enable DocSearch pkgdown website.","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/search.html","id":"indexing","dir":"Articles","previous_headings":"Bootstrap 3: Algolia","what":"Indexing","title":"Search","text":"published pkgdown website, submit pkgdown site URL Docsearch. Docsearch contact via e-mail confirm website owner. Docsearch set crawler configuration indexes site every 24 hours. pkgdown builds suggested Docsearch crawler configuration docsearch.json point Docsearch team configuration starting point. want optimize search, Docsearch accept pull requests configuration incorporate additional options fine tune scraping.","code":""},{"path":"https://pkgdown.r-lib.org/dev/articles/search.html","id":"configuration","dir":"Articles","previous_headings":"Bootstrap 3: Algolia","what":"Configuration","title":"Search","text":"Docsearch team e-mail JavaScript integrate website. Put value apiKey indexName parameters site _pkgdown.yml template: params: also need add url: field _pkgdown.yml specifies location documentation web. pkgdown, URL field : building custom Docsearch index, can also include Docsearch app_id _pkgdown.yml. See pkgdown configuration functional search configuration. configuration complete, find search bar re-building site. search enabled, pressing shift + / (.e., “?”) move focus search bar.","code":"