CINXE.COM
Build websites for R packages • pkgdown
<!DOCTYPE html> <!-- Generated by pkgdown: do not edit by hand --><html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Build websites for R packages • pkgdown</title> <!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"> <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"> <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="apple-touch-icon.png"> <link rel="apple-touch-icon" type="image/png" sizes="120x120" href="apple-touch-icon-120x120.png"> <link rel="apple-touch-icon" type="image/png" sizes="76x76" href="apple-touch-icon-76x76.png"> <link rel="apple-touch-icon" type="image/png" sizes="60x60" href="apple-touch-icon-60x60.png"> <script src="lightswitch.js"></script><script src="deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link href="deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"> <script src="deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="deps/font-awesome-6.4.2/css/all.min.css" rel="stylesheet"> <link href="deps/font-awesome-6.4.2/css/v4-shims.min.css" rel="stylesheet"> <script src="deps/headroom-0.11.0/headroom.min.js"></script><script src="deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="deps/search-1.0.0/fuse.min.js"></script><script src="deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="pkgdown.js"></script><meta property="og:title" content="Build websites for R packages"> <meta name="description" content="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."> <meta property="og:description" content="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."> <meta property="og:image" content="https://pkgdown.r-lib.org/logo.png"> <script defer data-domain="pkgdown.r-lib.org,all.tidyverse.org" src="https://plausible.io/js/plausible.js"></script> </head> <body> <a href="#main" class="visually-hidden-focusable">Skip to contents</a> <nav class="navbar navbar-expand-lg fixed-top " aria-label="Site navigation"><div class="container"> <a class="navbar-brand me-2" href="index.html">pkgdown</a> <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Released version">2.1.1</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div id="navbar" class="collapse navbar-collapse ms-3"> <ul class="navbar-nav me-auto"> <li class="nav-item"><a class="nav-link" href="articles/pkgdown.html">Get started</a></li> <li class="nav-item"><a class="nav-link" href="reference/index.html">Reference</a></li> <li class="nav-item dropdown"> <button class="nav-link dropdown-toggle" type="button" id="dropdown-articles" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">Articles</button> <ul class="dropdown-menu" aria-labelledby="dropdown-articles"> <li><a class="dropdown-item" href="articles/customise.html">Customise your site</a></li> <li><a class="dropdown-item" href="articles/quarto.html">quarto vignettes</a></li> <li><a class="dropdown-item" href="articles/translations.html">Translations</a></li> <li><a class="dropdown-item" href="articles/accessibility.html">Accessibility</a></li> <li><a class="dropdown-item" href="articles/linking.html">Auto-linking</a></li> <li><a class="dropdown-item" href="articles/metadata.html">Metadata</a></li> <li><hr class="dropdown-divider"></li> <li><a class="dropdown-item" href="articles/index.html">More articles...</a></li> </ul> </li> <li class="nav-item dropdown"> <button class="nav-link dropdown-toggle" type="button" id="dropdown-news" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">News</button> <ul class="dropdown-menu" aria-labelledby="dropdown-news"> <li><h6 class="dropdown-header" data-toc-skip>Releases</h6></li> <li><a class="external-link dropdown-item" href="https://www.tidyverse.org/blog/2024/07/pkgdown-2-1-0/">Version 2.1.0</a></li> <li><a class="external-link dropdown-item" href="https://www.tidyverse.org/blog/2021/12/pkgdown-2-0-0/">Version 2.0.0</a></li> <li><a class="external-link dropdown-item" href="https://www.tidyverse.org/blog/2020/09/pkgdown-1-6-0/">Version 1.6.0</a></li> <li><a class="external-link dropdown-item" href="https://www.tidyverse.org/blog/2020/03/pkgdown-1-5-0/">Version 1.5.0</a></li> <li><a class="external-link dropdown-item" href="https://www.tidyverse.org/articles/2019/09/pkgdown-1-4-0/">Version 1.4.0</a></li> <li><a class="external-link dropdown-item" href="https://www.tidyverse.org/articles/2018/12/pkgdown-1-3-0/">Version 1.3.0</a></li> <li><a class="external-link dropdown-item" href="https://www.tidyverse.org/articles/2018/06/pkgdown-1-1-0/">Version 1.1.0</a></li> <li><a class="external-link dropdown-item" href="https://www.tidyverse.org/articles/2018/05/pkgdown-1-0-0/">Version 1.0.0</a></li> <li><hr class="dropdown-divider"></li> <li><a class="dropdown-item" href="news/index.html">Changelog</a></li> </ul> </li> </ul> <ul class="navbar-nav"> <li class="nav-item"><form class="form-inline" role="search"> <input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="search.json"> </form></li> <li class="nav-item"><a class="external-link nav-link" href="https://github.com/r-lib/pkgdown/" aria-label="GitHub"><span class="fa fab fa-github fa-lg"></span></a></li> <li class="nav-item dropdown"> <button class="nav-link dropdown-toggle" type="button" id="dropdown-lightswitch" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true" aria-label="Light switch"><span class="fa fa-sun"></span></button> <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdown-lightswitch"> <li><button class="dropdown-item" data-bs-theme-value="light"><span class="fa fa-sun"></span> Light</button></li> <li><button class="dropdown-item" data-bs-theme-value="dark"><span class="fa fa-moon"></span> Dark</button></li> <li><button class="dropdown-item" data-bs-theme-value="auto"><span class="fa fa-adjust"></span> Auto</button></li> </ul> </li> </ul> </div> </div> </nav><div class="container template-home"> <div class="row"> <main id="main" class="col-md-9"><div class="section level1"> <div class="page-header"> <img src="logo.png" class="logo" alt=""><h1 id="pkgdown-">pkgdown <a class="anchor" aria-label="anchor" href="#pkgdown-"></a> </h1> </div> <!-- badges: start --> <p>pkgdown is designed to make it quick and easy to build a website for your package. You can see pkgdown in action at <a href="https://pkgdown.r-lib.org" class="uri">https://pkgdown.r-lib.org</a>: this is the output of pkgdown applied to the latest version of pkgdown. Learn more in <code><a href="articles/pkgdown.html">vignette("pkgdown")</a></code> or <code><a href="reference/build_site.html">?build_site</a></code>.</p> <div class="section level2"> <h2 id="installation">Installation<a class="anchor" aria-label="anchor" href="#installation"></a> </h2> <div class=".pkgdown-release"> <div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span><span class="co"># Install released version from CRAN</span></span> <span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">"pkgdown"</span><span class="op">)</span></span></code></pre></div> </div> </div> <div class="section level2"> <h2 id="usage">Usage<a class="anchor" aria-label="anchor" href="#usage"></a> </h2> <p>Get started with <a href="https://usethis.r-lib.org/" class="external-link">usethis</a>:</p> <div class="sourceCode" id="cb3"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span><span class="co"># Run once to configure your package to use and deploy pkgdown</span></span> <span><span class="fu">usethis</span><span class="fu">::</span><span class="fu"><a href="https://usethis.r-lib.org/reference/use_pkgdown.html" class="external-link">use_pkgdown_github_pages</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div> <div class="sourceCode" id="cb4"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span><span class="co"># Preview your site locally before publishing</span></span> <span><span class="fu">pkgdown</span><span class="fu">::</span><span class="fu"><a href="reference/build_site.html">build_site</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div> <p>This adds the necessary components and sets up GitHub Actions<a class="footnote-ref" tabindex="0" data-bs-toggle="popover" data-bs-content='<p>If you don’t use GitHub, you can use <code><a href="https://usethis.r-lib.org/reference/use_pkgdown.html" class="external-link">usethis::use_pkgdown()</a></code> + <code><a href="reference/build_site.html">pkgdown::build_site()</a></code> to create a website.</p>'><sup>1</sup></a> for automatic site building when deploying. Your <code>README.md</code> becomes the homepage, documentation in <code>man/</code> generates a function reference, and vignettes will be rendered into <code>articles/</code>.</p> <div class="section level3"> <h3 id="pkgdown-200-and-bootstrap-5">pkgdown 2.0.0 and Bootstrap 5<a class="anchor" aria-label="anchor" href="#pkgdown-200-and-bootstrap-5"></a> </h3> <p>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 <code>_pkgdown.yml</code>:</p> <div class="sourceCode" id="cb5"><pre class="sourceCode yaml"><code class="sourceCode yaml"><span id="cb5-1"><a href="#cb5-1" tabindex="-1"></a><span class="fu">template</span><span class="kw">:</span></span> <span id="cb5-2"><a href="#cb5-2" tabindex="-1"></a><span class="at"> </span><span class="fu">bootstrap</span><span class="kw">:</span><span class="at"> </span><span class="dv">5</span></span></code></pre></div> <p>Then learn about the many new ways to customise your site in <code><a href="articles/customise.html">vignette("customise")</a></code>.</p> </div> </div> <div class="section level2"> <h2 id="in-the-wild">In the wild<a class="anchor" aria-label="anchor" href="#in-the-wild"></a> </h2> <p>At last count, pkgdown is used <a href="https://github.com/search?q=path%3A_pkgdown.yml+language%3AYAML&type=code&l=YAML" class="external-link">by over 12,000 packages</a>. Here are a few examples:</p> <ul> <li><p><a href="http://mc-stan.org/bayesplot/index.html" class="external-link">bayesplot</a> (<a href="https://github.com/stan-dev/bayesplot/tree/gh-pages" class="external-link">source</a>): plotting functions for posterior analysis, model checking, and MCMC diagnostics.</p></li> <li><p><a href="https://rnabioco.github.io/valr/" class="external-link">valr</a> (<a href="https://github.com/rnabioco/valr" class="external-link">source</a>): read and manipulate genome intervals and signals.</p></li> <li><p><a href="https://pkgdown.jrwb.de/mkin/" class="external-link">mkin</a> (<a href="https://github.com/jranke/mkin" class="external-link">source</a>): calculation routines based on the FOCUS Kinetics Report</p></li> <li><p><a href="http://renozao.github.io/NMF/master/index.html" class="external-link">NMF</a> (<a href="https://github.com/renozao/NMF" class="external-link">source</a>): a framework to perform non-negative matrix factorization (NMF).</p></li> <li><p><a href="https://github.com/search?q=path%3A%22_pkgdown.yml%22+AND+%28org%3Atidyverse+OR+org%3Ar-lib%29&type=code" class="external-link">tidyverse and r-lib packages source</a></p></li> </ul> <p>Comparing the source and output of these sites is a great way to learn new pkgdown techniques.</p> </div> <div class="section level2"> <h2 id="code-of-conduct">Code of conduct<a class="anchor" aria-label="anchor" href="#code-of-conduct"></a> </h2> <p>Please note that this project is released with a <a href="https://pkgdown.r-lib.org/CODE_OF_CONDUCT.html">Contributor Code of Conduct</a>. By participating in this project you agree to abide by its terms.</p> </div> </div> </main><aside class="col-md-3"><div class="links"> <h2 data-toc-skip>Links</h2> <ul class="list-unstyled"> <li><a href="https://cloud.r-project.org/package=pkgdown" class="external-link">View on CRAN</a></li> <li><a href="https://github.com/r-lib/pkgdown/" class="external-link">Browse source code</a></li> <li><a href="https://github.com/r-lib/pkgdown/issues" class="external-link">Report a bug</a></li> </ul> </div> <div class="license"> <h2 data-toc-skip>License</h2> <ul class="list-unstyled"> <li><a href="LICENSE.html">Full license</a></li> <li><small><a href="https://opensource.org/licenses/mit-license.php" class="external-link">MIT</a> + file <a href="LICENSE-text.html">LICENSE</a></small></li> </ul> </div> <div class="community"> <h2 data-toc-skip>Community</h2> <ul class="list-unstyled"> <li><a href="CONTRIBUTING.html">Contributing guide</a></li> <li><a href="CODE_OF_CONDUCT.html">Code of conduct</a></li> </ul> </div> <div class="citation"> <h2 data-toc-skip>Citation</h2> <ul class="list-unstyled"> <li><a href="authors.html#citation">Citing pkgdown</a></li> </ul> </div> <div class="developers"> <h2 data-toc-skip>Developers</h2> <ul class="list-unstyled"> <li> <a href="https://hadley.nz" class="external-link">Hadley Wickham</a> <br><small class="roles"> Author, maintainer </small> <a href="https://orcid.org/0000-0003-4757-117X" target="orcid.widget" aria-label="ORCID" class="external-link"><span class="fab fa-orcid orcid" aria-hidden="true"></span></a> </li> <li> <a href="https://hesselberthlab.org" class="external-link">Jay Hesselberth</a> <br><small class="roles"> Author </small> <a href="https://orcid.org/0000-0002-6299-179X" target="orcid.widget" aria-label="ORCID" class="external-link"><span class="fab fa-orcid orcid" aria-hidden="true"></span></a> </li> <li> <a href="https://masalmon.eu" class="external-link">Maëlle Salmon</a> <br><small class="roles"> Author </small> <a href="https://orcid.org/0000-0002-2815-0399" target="orcid.widget" aria-label="ORCID" class="external-link"><span class="fab fa-orcid orcid" aria-hidden="true"></span></a> </li> <li>Olivier Roy <br><small class="roles"> Author </small> </li> <li> <a href="https://salim.space" class="external-link">Salim Brüggemann</a> <br><small class="roles"> Author </small> <a href="https://orcid.org/0000-0002-5329-5987" target="orcid.widget" aria-label="ORCID" class="external-link"><span class="fab fa-orcid orcid" aria-hidden="true"></span></a> </li> <li> <a href="https://posit.co" class="external-link">Posit Software, PBC</a> <br><small class="roles"> Copyright holder, funder </small> </li> </ul> </div> </aside> </div> <footer><div class="pkgdown-footer-left"> <p>Developed by <a href="https://hadley.nz" class="external-link">Hadley Wickham</a>, <a href="https://hesselberthlab.org" class="external-link">Jay Hesselberth</a>, <a href="https://masalmon.eu" class="external-link">Maëlle Salmon</a>, Olivier Roy, <a href="https://salim.space" class="external-link">Salim Brüggemann</a>, <a href="https://posit.co" class="external-link">Posit Software, PBC</a>.</p> </div> <div class="pkgdown-footer-right"> <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 2.1.1.</p> </div> </footer> </div> </body> </html>