pkgdown Documentation

repository·main·Indexed 20 days ago

https://github.com/r-lib/pkgdown

A tool for building professional websites for R packages by transforming package documentation, vignettes, and README files into a structured, navigable site. Supports local builds via pkgdown::build_site() and automatic deployment to GitHub Pages using GitHub Actions.

Tokens
488
Snippets
4
Records
4
Agent score
23%

What's inside pkgdown

  1. Install pkgdown

    main

    You can install the released version of pkgdown from CRAN or the development version from GitHub.

    Install from CRAN

    Use the standard install.packages() command.

    Install development version from GitHub

    It is recommended to use pak to install the development version.

    If you do not use GitHub, you can use usethis::use_pkgdown() followed by pkgdown::build_site() to create a website locally.

    # Install released version from CRAN
    install.packages("pkgdown")
    
    # Install development version from GitHub
    pak::pak("r-lib/pkgdown")
  2. Configure and deploy pkgdown to GitHub Pages

    main

    To set up your package for automatic site building and deployment via GitHub Actions, use the usethis package. This process:

    • Configures your package to use and deploy pkgdown.
    • Sets up GitHub Actions for automatic site building.
    • Converts your README.md into the homepage.
    • Generates a function reference from documentation in man/.
    • Renders vignettes into articles/.

    If you are not using GitHub, use usethis::use_pkgdown() instead.

    # Run once to configure your package to use and deploy pkgdown
    usethis::use_pkgdown_github_pages()
  3. Opt-in to Bootstrap 5 in pkgdown 2.0.0+

    main

    Starting with version 2.0.0, pkgdown upgraded from Bootstrap 3 to Bootstrap 5. To prevent breaking existing highly customized sites, this upgrade requires an explicit opt-in. Add the following configuration to your _pkgdown.yml file to use Bootstrap 5.

    template:
      bootstrap: 5