Make Static HTML Documentation for a Package

Generate an attractive and useful website from a source package. 'pkgdown' converts your documentation, vignettes, 'README', and more to 'HTML' making it easy to share information about your package online.


pkgdown pkgdown website

CRAN Status R-CMD-check Codecov testcoverage

pkgdown is designed to make it quick and easy to build a website for your package. You can see pkgdown in action at https://pkgdown.r-lib.org: this is the output of pkgdown applied to the latest version of pkgdown. Learn more in vignette("pkgdown") or ?build_site.

Installation

# Install released version from CRAN
install.packages("pkgdown")
# Install development version from GitHub
# install.packages("pak")
pak::pak("r-lib/pkgdown")

Usage

Get started with usethis:

# Run once to configure your package to use and deploy pkgdown
usethis::use_pkgdown_github_pages()
# Preview your site locally before publishing
pkgdown::build_site()

This adds the necessary components and sets up GitHub Actions[^1] for automatic site building when deploying. Your README.md becomes the homepage, documentation in man/ generates a function reference, and vignettes will be rendered into articles/.

pkgdown 2.0.0 and Bootstrap 5

pkgdown 2.0.0 includes an upgrade from Bootstrap 3 to Bootstrap 5, which is accompanied by a whole bunch of minor UI improvements. If you’ve heavily customised your site, there’s a small chance that this will break your site, so everyone needs to explicitly opt-in to the upgrade by adding the following to _pkgdown.yml:

template:
  bootstrap: 5

Then learn about the many new ways to customise your site in vignette("customise").

In the wild

At last count, pkgdown is used by over 12,000 packages. Here are a few examples:

Comparing the source and output of these sites is a great way to learn new pkgdown techniques.

Code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

[^1]: If you don’t use GitHub, you can use usethis::use_pkgdown() + pkgdown::build_site() to create a website.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("pkgdown")

2.2.1 by Hadley Wickham, 3 months ago


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


Report a bug at https://github.com/r-lib/pkgdown/issues


Browse source code at https://github.com/cran/pkgdown


Authors: Hadley Wickham [aut, cre] (ORCID: , Jay Hesselberth [aut] , Maëlle Salmon [aut] , Olivier Roy [aut] , Salim Brüggemann [aut] , Posit Software , PBC [cph, fnd] (ROR: <https://ror.org/03wc8by49>)


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports bslib, callr, cli, desc, downlit, fontawesome, fs, httr2, jsonlite, lifecycle, openssl, purrr, ragg, rlang, rmarkdown, tibble, whisker, withr, xml2, yaml

Suggests covr, diffviewer, evaluate, gert, gt, htmltools, htmlwidgets, knitr, magick, methods, nanonext, pkgload, quarto, rsconnect, rstudioapi, rticles, sass, testthat, tools

System requirements: pandoc (>= 2.10.1)


Imported by CALANGO, devtools, pkgdown.offline, washr.

Suggested by AMDconfigurations, Athlytics, BIOMASS, BeeBDC, CAISEr, CVglasso, CircularRegression, CodeCarbonR, DSAIDE, DSAIRM, EGRET, EGRETci, FSAdata, FSelectorRcpp, FastRet, FocusGroup, GLMMadaptive, Immutables, JMbayes2, JumpDiffSim, LDATS, LPWC, MFSIS, MIMSunit, MOEADr, ManyIVsNets, MetaRVM, NetworkExtinction, PNADCperiods, PONG2, PROsetta, R4VN, R62S3, RFishBC, RSQL, ResultModelManager, RobustMediate, RougeLM, Rpolyhedra, SCDB, SDMtune, SelectBoost.FDA, SelectBoost.gamlss, SepTest, SimpleUpset, TAD, TKApprox, TemporalHazard, TestDesign, VectrixDB, W4MRUtils, acR, activAnalyzer, admiraldev, admiralonco, admiralophtha, admiralvaccine, ahocorasick, aifeducation, albersdown, altair, amorem, anovapowersim, arenar, aricode, assemblykor, authordown, autoFlagR, azlogr, badp, bayefdr, bidser, biocohort, blockr.dplyr, blockr.ggplot, bluertopo, blueterra, boids4R, bootGOF, brightspaceR, buildr, campsis, campsismod, campsisnca, caretEnsemble, carwatch, causalsim, causens, charisma, cifmodeling, clustree, collatz, colorednoise, cookies, correctR, courieR, cucumber, cvGEE, datacutr, datadriftR, dataganger, datasusr, date4ts, dbmss, designit, diffcp, diseasystore, distributional, divent, dqcheckr, dqcheckrGUI, dragmapr, easyalluvial, edgarWebR, elisr, entropart, epigraphdb, eventPred, evolution, exams2ilias, fakir, fb4package, ferrn, finlex, fishualize, flextable, galah, geohabnet, ggRandomForests, ggWebGL, ggdist, ggmeta, ggpaintr, ggpower, ggquiver, ggrank, ggsoccer, golem, googleErrorReportingR, gp3ml, griddy, grouper, gtregression, gtstats, hcruR, hmsidwR, hotpatchR, htaBIM, hyd1d, hydflood, hypothesis, ibger, ihsMW, immunarch, infoelectoral, inkaR, inlcolor, inlpubs, irtQ, jiebaRS, joineRML, jpmap, koma, latrend, lcda, lehdr, levitate, linguisticsdown, lobstr, locatr, logrx, logtree, lrstat, mSigPlot, marginaleffects, marimekko, marinepredator, measureR, memoiR, minSNPs, mizer, modelskill, modernBoot, mongolstats, monitOS, motifr, multinma, mverse, myIO, ncdfgeom, neotoma2, netOP, neuroim2, normaliseR, nprcgenekeepr, nwaa, oda, olympicAthletes, openeo, openrouteservice, orbitr, overviewR, pacta.multi.loanbook, pagerankr, palettes, pcatR, peppwR, pharmaverseadam, pharmaverseraw, pharmaversesdtm, pigauto, pizzarr, pkgnet, prakriti, precommit, prepR4pcm, pressfreedom, probcal, projectLSA, public.ctn0094data, putior, quartose, radiant.basics, radiant.data, radiant.design, radiant.model, radiant.multivariate, rangeMapper, rasterpdf, ravel, rbranding, rdatagouv, rdborrow, realestatebr, rgl, rkaf, rmdd, rmdpartials, rmoriebricklayer, roxy.shinylive, rsmart, rumenGP, runcharter, rurl, scDiffCom, scorecard, serp, sevenbridges2, sfcr, shewhartr, shiny.ollama, shiny.webawesome, shinydataviewer, simaerep, simhelpers, siteymlgen, smfa, spiritR, splineplot, ssddata, ssel, starter, states, stats19, stencilaschema, sugarbag, tables, tabular, talkr, tergo, texanshootR, theft, theftdlc, theorytools, tidyaudit, tidybayes, tikatuwq, tinytable, toolStability, transltr, trialdiff, trtswitch, unexcel, unifir, unitcm, upsetjs, usa, vbm, vctrs, vennDiagramLab, virustotal, visPedigree, volcanoes, webexercises, webmap, whapi, worcs, wstats, xgxr, xkcd, xmlrectr, ymlthis.


See at CRAN