Skip to content

Commit be1ffdb

Browse files
Update for pkgdown bs5 (#668)
* initial update for pkgdown bs5 * reorganize the navbar * update yamls and add descriptions for vignettes * Edits to pkgdown update * Don't need old favicons here Co-authored-by: Julia Silge <julia.silge@gmail.com>
1 parent 3e2447c commit be1ffdb

File tree

7 files changed

+62
-56
lines changed

7 files changed

+62
-56
lines changed

.github/workflows/pkgdown.yaml

+17-20
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3-
# Add Config/Needs/website: tidyverse/tidytemplate to DESCRIPTION
43
on:
54
push:
65
branches: [main, master]
7-
tags: ['*']
86
pull_request:
97
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
1011

1112
name: pkgdown
1213

1314
jobs:
1415
pkgdown:
1516
runs-on: ubuntu-latest
17+
# Only restrict concurrency for non-PR jobs
18+
concurrency:
19+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1620
env:
1721
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1822
steps:
@@ -26,13 +30,9 @@ jobs:
2630

2731
- uses: r-lib/actions/setup-r-dependencies@v2
2832
with:
29-
extra-packages: r-lib/pkgdown
33+
extra-packages: any::pkgdown, local::.
3034
needs: website
3135

32-
- name: Install dev reticulate
33-
run: pak::pkg_install('rstudio/reticulate')
34-
shell: Rscript {0}
35-
3636
- name: Install Miniconda
3737
# conda can fail at downgrading python, so we specify python version in advance
3838
env:
@@ -45,17 +45,14 @@ jobs:
4545
tensorflow::install_tensorflow(version='2.7', conda_python_version = NULL)
4646
shell: Rscript {0}
4747

48-
- name: Install package
49-
run: R CMD INSTALL .
50-
5148
- name: Build site
52-
if: github.event_name == 'pull_request'
53-
run: |
54-
Rscript -e 'pkgdown::build_site()'
49+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
50+
shell: Rscript {0}
5551

56-
- name: Deploy package
57-
if: github.event_name == 'push'
58-
run: |
59-
git config --local user.name "$GITHUB_ACTOR"
60-
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
61-
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
52+
- name: Deploy to GitHub pages 🚀
53+
if: github.event_name != 'pull_request'
54+
uses: JamesIves/github-pages-deploy-action@4.1.4
55+
with:
56+
clean: false
57+
branch: gh-pages
58+
folder: docs

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ derby.log
99
logs/*
1010
revdep/*
1111
docs*
12+
docs

DESCRIPTION

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Description: A common interface is provided to allow users to specify a
1313
different functions or computational engines (e.g. 'R', 'Spark',
1414
'Stan', etc).
1515
License: MIT + file LICENSE
16-
URL: https://parsnip.tidymodels.org, https://github.com/tidymodels/parsnip
16+
URL: https://github.com/tidymodels/parsnip,
17+
https://parsnip.tidymodels.org/
1718
BugReports: https://github.com/tidymodels/parsnip/issues
1819
Depends:
1920
R (>= 2.10)
@@ -82,6 +83,7 @@ Config/Needs/website:
8283
rstanarm,
8384
tidymodels/tidymodels,
8485
tidyverse/tidytemplate,
86+
rstudio/reticulate,
8587
xgboost
8688
Config/rcmdcheck/ignore-inconsequential-notes: true
8789
Encoding: UTF-8

_pkgdown.yml

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
url: https://parsnip.tidymodels.org
1+
url: https://parsnip.tidymodels.org/
2+
3+
navbar:
4+
components:
5+
home: ~
6+
tutorials:
7+
text: Learn more
8+
menu:
9+
- text: "Regression modeling"
10+
href: https://www.tidymodels.org/learn/models/parsnip-ranger-glmnet/
11+
- text: "Classification modeling"
12+
href: https://www.tidymodels.org/learn/models/parsnip-nnet/
13+
- text: "Making a parsnip model from scratch"
14+
href: https://www.tidymodels.org/learn/develop/models/
215

316
template:
17+
package: tidytemplate
418
bootstrap: 5
519
bslib:
6-
danger: "#CA225E"
720
primary: "#CA225E"
8-
package: tidytemplate
21+
22+
includes:
23+
in_header: |
24+
<script defer data-domain="parsnip.tidymodels.org,all.tidymodels.org" src="https://plausible.io/js/plausible.js"></script>
925
1026
development:
1127
mode: auto
@@ -72,7 +88,7 @@ reference:
7288
- translate
7389
- starts_with("update")
7490

75-
- title: Developer Tools
91+
- title: Developer tools
7692
contents:
7793
- contr_one_hot
7894
- set_new_model
@@ -81,20 +97,3 @@ reference:
8197
- required_pkgs
8298
- required_pkgs.model_spec
8399
- req_pkgs
84-
85-
navbar:
86-
components:
87-
articles:
88-
text: Articles
89-
menu:
90-
- text: Regression modeling
91-
href: https://www.tidymodels.org/learn/models/parsnip-ranger-glmnet/
92-
- text: Classification modeling
93-
href: https://www.tidymodels.org/learn/models/parsnip-nnet/
94-
- text: Making a parsnip model from scratch
95-
href: https://www.tidymodels.org/learn/develop/models/
96-
- text: Evaluating submodels with the same model object
97-
href: articles/articles/Submodels.html
98-
- text: Fitting and predicting with parsnip
99-
href: articles/articles/Examples.html
100-

vignettes/articles/Examples.Rmd

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---
2-
title: "Fitting and Predicting with parsnip"
2+
title: "Fitting and predicting with parsnip"
3+
output: rmarkdown::html_vignette
4+
description: |
5+
This vignette show how to **fit** and **predict** with different
6+
combinations of model, mode, and engine.
37
vignette: >
48
%\VignetteEngine{knitr::rmarkdown}
5-
%\VignetteIndexEntry{Fitting and Predicting with parsnip}
6-
output:
7-
knitr:::html_vignette
9+
%\VignetteIndexEntry{Fitting and predicting with parsnip}
10+
%\VignetteEncoding{UTF-8}
811
---
912

1013
```{r startup, include = FALSE}

vignettes/articles/Submodels.Rmd

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
2-
title: "Evaluating Submodels with the Same Model Object"
2+
title: "Evaluating submodels with the same model object"
3+
output: rmarkdown::html_vignette
4+
description: |
5+
You can use `multi_predict()` to evaluate submodels with the same model object
6+
and avoid having to fit any of the submodels.
37
vignette: >
48
%\VignetteEngine{knitr::rmarkdown}
5-
%\VignetteIndexEntry{Evaluating Submodels with the Same Model Object}
6-
output:
7-
knitr:::html_vignette:
8-
toc: yes
9+
%\VignetteIndexEntry{Evaluating submodels with the same model object}
10+
%\VignetteEncoding{UTF-8}
911
---
1012

1113
```{r startup, include = FALSE}

vignettes/parsnip.Rmd

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
2-
title: "parsnip Basics"
2+
title: "Introduction to parsnip"
3+
output: rmarkdown::html_vignette
4+
description: |
5+
The goal of parsnip is to provide a tidy, unified interface to models to avoid
6+
getting bogged down in the syntactical minutiae of the underlying software.
37
vignette: >
48
%\VignetteEngine{knitr::rmarkdown}
5-
%\VignetteIndexEntry{parsnip Basics}
6-
output:
7-
knitr:::html_vignette:
8-
toc: yes
9+
%\VignetteIndexEntry{Introduction to parsnip}
10+
%\VignetteEncoding{UTF-8}
911
---
1012

1113
```{r ex_setup, include=FALSE}

0 commit comments

Comments
 (0)