Skip to content

Commit 0ddc47b

Browse files
authored
Merge pull request #292 from stan-dev/reformat-packagedown-workflow
Reformat pkgdown workflow
2 parents 2e1b995 + e840f59 commit 0ddc47b

File tree

51 files changed

+253
-1556
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+253
-1556
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ vignettes/loo2-non-factorizable_cache/*
2222

2323
^CRAN-SUBMISSION$
2424
^release-prep\.R$
25+
^_pkgdown\.yml$
26+
^pkgdown$

.github/workflows/pkgdown.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
# build dev site on merged pushes
5+
push:
6+
branches: [main, master]
7+
# build full site on releases
8+
release:
9+
types: [published]
10+
workflow_dispatch:
11+
12+
name: pkgdown.yaml
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: true
17+
18+
jobs:
19+
pkgdown:
20+
runs-on: ubuntu-latest
21+
env:
22+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: r-lib/actions/setup-pandoc@v2
29+
30+
- uses: r-lib/actions/setup-r@v2
31+
with:
32+
use-public-rspm: true
33+
34+
- uses: r-lib/actions/setup-r-dependencies@v2
35+
with:
36+
extra-packages: any::pkgdown, local::., any::withr, stan-dev/pkgdown-config
37+
38+
# - uses: actions/cache@v4
39+
# with:
40+
# path: vignettes/**/_cache
41+
# key: knitr-${{ runner.os }}-${{ hashFiles('vignettes/**/*.Rmd') }}
42+
43+
- name: Build site
44+
run: |
45+
withr::with_envvar(
46+
c("NOT_CRAN" = "true"), # this should already be set by setup-r@v2? keeping because vignettes don't build otherwise
47+
pkgdown::build_site_github_pages(
48+
lazy = FALSE, # change to TRUE if runner times out.
49+
run_dont_run = TRUE,
50+
new_process = TRUE
51+
)
52+
)
53+
shell: Rscript {0}
54+
55+
- name: Deploy to GitHub pages 🚀
56+
uses: JamesIves/[email protected]
57+
with:
58+
clean: false
59+
branch: gh-pages
60+
folder: docs

_pkgdown.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
url: https://mc-stan.org/loo/
2+
destination: "docs/"
3+
template:
4+
package: pkgdownconfig
5+
development:
6+
mode: auto
7+
8+
navbar:
9+
title: "loo"
10+
11+
structure:
12+
left: [home, vignettes, functions, pkgs, news, stan]
13+
right: [search, bluesky, twitter, forum, github, lightswitch]
14+
15+
components:
16+
home:
17+
icon: fa-home fa-lg
18+
href: index.html
19+
vignettes:
20+
text: Vignettes
21+
href: articles/index.html
22+
functions:
23+
text: Functions
24+
href: reference/index.html
25+
pkgs:
26+
text: Other Packages
27+
menu:
28+
- text: rstan
29+
href: https://mc-stan.org/rstan
30+
- text: cmdstanr
31+
href: https://mc-stan.org/cmdstanr
32+
- text: rstanarm
33+
href: https://mc-stan.org/rstanarm
34+
- text: bayesplot
35+
href: https://mc-stan.org/bayesplot
36+
- text: shinystan
37+
href: https://mc-stan.org/shinystan
38+
- text: projpred
39+
href: https://mc-stan.org/projpred
40+
- text: rstantools
41+
href: https://mc-stan.org/rstantools
42+
- text: posterior
43+
href: https://mc-stan.org/posterior
44+
45+
articles:
46+
- title: Getting started
47+
desc: |
48+
These vignettes demonstrate how to use the **loo** package to perform approximate leave-one-out cross-validation or exact K-fold cross-validation for Bayesian models fit using MCMC, compare models on estimated predictive performance on new data, and weight models for averaging predictive distributions.
49+
contents:
50+
- loo2-example
51+
- loo2-weights
52+
- loo2-with-rstan
53+
- loo2-elpd
54+
- title: Additional topics
55+
desc: |
56+
These vignettes demonstrate how to use the **loo** package for more complicated scenarios including models with non-factorized likelihoods, forecasting models, models fit to very large datasets, and more.
57+
contents:
58+
- loo2-non-factorized
59+
- loo2-lfo
60+
- loo2-large-data
61+
- loo2-moment-matching
62+
- loo2-mixis
63+
- title: Frequently asked questions
64+
contents:
65+
- faq
66+
67+
external-articles:
68+
- name: faq
69+
title: Cross-validation FAQ
70+
description: Answers to frequently asked questions about cross-validation and the **loo** package (links to external site).
71+
href: https://users.aalto.fi/~ave/CV-FAQ.html
72+
73+
reference:
74+
- title: Package description, glossary, and included data sets
75+
contents:
76+
- loo-package
77+
- loo-glossary
78+
- loo-datasets
79+
- title: Approximate LOO-CV
80+
desc: |
81+
Approximate LOO-CV, Pareto smoothed importance sampling (PSIS), and diagnostics.
82+
contents:
83+
- loo
84+
- loo_subsample
85+
- loo_approximate_posterior
86+
- loo_moment_match
87+
- loo_moment_match_split
88+
- E_loo
89+
- psis
90+
- ap_psis
91+
- tis
92+
- sis
93+
- importance_sampling
94+
- weights.importance_sampling
95+
- pareto-k-diagnostic
96+
- title: Model comparison weighting/averaging
97+
desc: |
98+
Functions for comparing models and computing model weights via stacking of predictive distributions or pseudo-BMA weighting.
99+
contents:
100+
- loo_compare
101+
- loo_model_weights
102+
- stacking_weights
103+
- pseudobma_weights
104+
- title: Helper functions for K-fold CV
105+
contents:
106+
- kfold_split_random
107+
- kfold_split_stratified
108+
- kfold_split_grouped
109+
- kfold
110+
- elpd
111+
- title: Other functions
112+
contents:
113+
- loo_predictive_metric
114+
- crps
115+
- elpd
116+
- waic
117+
- extract_log_lik
118+
- pointwise
119+
- relative_eff
120+
- gpdfit
121+
- starts_with("example_loglik")
122+
- print.loo
123+
- nobs.psis_loo_ss
124+
- obs_idx
125+
- update.psis_loo_ss
126+
- title: Deprecated functions
127+
contents:
128+
- compare
129+
- psislw

man/figures/logo.svg

Lines changed: 1 addition & 96 deletions

man/figures/stanlogo.png

-15.8 KB
Binary file not shown.
8.31 KB

pkgdown/favicon/favicon-96x96.png

3.79 KB

pkgdown/favicon/favicon.ico

14.7 KB
Binary file not shown.

pkgdown/favicon/favicon.svg

Lines changed: 3 additions & 0 deletions

pkgdown/favicon/site.webmanifest

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "",
3+
"short_name": "",
4+
"icons": [
5+
{
6+
"src": "/web-app-manifest-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png",
9+
"purpose": "maskable"
10+
},
11+
{
12+
"src": "/web-app-manifest-512x512.png",
13+
"sizes": "512x512",
14+
"type": "image/png",
15+
"purpose": "maskable"
16+
}
17+
],
18+
"theme_color": "#ffffff",
19+
"background_color": "#ffffff",
20+
"display": "standalone"
21+
}

0 commit comments

Comments
 (0)