Skip to content

Commit

Permalink
Update for pkgdown bs5 (#668)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
EmilHvitfeldt and juliasilge authored Feb 28, 2022
1 parent 3e2447c commit be1ffdb
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 56 deletions.
37 changes: 17 additions & 20 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
# Add Config/Needs/website: tidyverse/tidytemplate to DESCRIPTION
on:
push:
branches: [main, master]
tags: ['*']
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand All @@ -26,13 +30,9 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: r-lib/pkgdown
extra-packages: any::pkgdown, local::.
needs: website

- name: Install dev reticulate
run: pak::pkg_install('rstudio/reticulate')
shell: Rscript {0}

- name: Install Miniconda
# conda can fail at downgrading python, so we specify python version in advance
env:
Expand All @@ -45,17 +45,14 @@ jobs:
tensorflow::install_tensorflow(version='2.7', conda_python_version = NULL)
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Build site
if: github.event_name == 'pull_request'
run: |
Rscript -e 'pkgdown::build_site()'
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy package
if: github.event_name == 'push'
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ derby.log
logs/*
revdep/*
docs*
docs
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Description: A common interface is provided to allow users to specify a
different functions or computational engines (e.g. 'R', 'Spark',
'Stan', etc).
License: MIT + file LICENSE
URL: https://parsnip.tidymodels.org, https://github.com/tidymodels/parsnip
URL: https://github.com/tidymodels/parsnip,
https://parsnip.tidymodels.org/
BugReports: https://github.com/tidymodels/parsnip/issues
Depends:
R (>= 2.10)
Expand Down Expand Up @@ -82,6 +83,7 @@ Config/Needs/website:
rstanarm,
tidymodels/tidymodels,
tidyverse/tidytemplate,
rstudio/reticulate,
xgboost
Config/rcmdcheck/ignore-inconsequential-notes: true
Encoding: UTF-8
Expand Down
41 changes: 20 additions & 21 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
url: https://parsnip.tidymodels.org
url: https://parsnip.tidymodels.org/

navbar:
components:
home: ~
tutorials:
text: Learn more
menu:
- text: "Regression modeling"
href: https://www.tidymodels.org/learn/models/parsnip-ranger-glmnet/
- text: "Classification modeling"
href: https://www.tidymodels.org/learn/models/parsnip-nnet/
- text: "Making a parsnip model from scratch"
href: https://www.tidymodels.org/learn/develop/models/

template:
package: tidytemplate
bootstrap: 5
bslib:
danger: "#CA225E"
primary: "#CA225E"
package: tidytemplate

includes:
in_header: |
<script defer data-domain="parsnip.tidymodels.org,all.tidymodels.org" src="https://plausible.io/js/plausible.js"></script>
development:
mode: auto
Expand Down Expand Up @@ -72,7 +88,7 @@ reference:
- translate
- starts_with("update")

- title: Developer Tools
- title: Developer tools
contents:
- contr_one_hot
- set_new_model
Expand All @@ -81,20 +97,3 @@ reference:
- required_pkgs
- required_pkgs.model_spec
- req_pkgs

navbar:
components:
articles:
text: Articles
menu:
- text: Regression modeling
href: https://www.tidymodels.org/learn/models/parsnip-ranger-glmnet/
- text: Classification modeling
href: https://www.tidymodels.org/learn/models/parsnip-nnet/
- text: Making a parsnip model from scratch
href: https://www.tidymodels.org/learn/develop/models/
- text: Evaluating submodels with the same model object
href: articles/articles/Submodels.html
- text: Fitting and predicting with parsnip
href: articles/articles/Examples.html

11 changes: 7 additions & 4 deletions vignettes/articles/Examples.Rmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
title: "Fitting and Predicting with parsnip"
title: "Fitting and predicting with parsnip"
output: rmarkdown::html_vignette
description: |
This vignette show how to **fit** and **predict** with different
combinations of model, mode, and engine.
vignette: >
%\VignetteEngine{knitr::rmarkdown}
%\VignetteIndexEntry{Fitting and Predicting with parsnip}
output:
knitr:::html_vignette
%\VignetteIndexEntry{Fitting and predicting with parsnip}
%\VignetteEncoding{UTF-8}
---

```{r startup, include = FALSE}
Expand Down
12 changes: 7 additions & 5 deletions vignettes/articles/Submodels.Rmd
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: "Evaluating Submodels with the Same Model Object"
title: "Evaluating submodels with the same model object"
output: rmarkdown::html_vignette
description: |
You can use `multi_predict()` to evaluate submodels with the same model object
and avoid having to fit any of the submodels.
vignette: >
%\VignetteEngine{knitr::rmarkdown}
%\VignetteIndexEntry{Evaluating Submodels with the Same Model Object}
output:
knitr:::html_vignette:
toc: yes
%\VignetteIndexEntry{Evaluating submodels with the same model object}
%\VignetteEncoding{UTF-8}
---

```{r startup, include = FALSE}
Expand Down
12 changes: 7 additions & 5 deletions vignettes/parsnip.Rmd
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: "parsnip Basics"
title: "Introduction to parsnip"
output: rmarkdown::html_vignette
description: |
The goal of parsnip is to provide a tidy, unified interface to models to avoid
getting bogged down in the syntactical minutiae of the underlying software.
vignette: >
%\VignetteEngine{knitr::rmarkdown}
%\VignetteIndexEntry{parsnip Basics}
output:
knitr:::html_vignette:
toc: yes
%\VignetteIndexEntry{Introduction to parsnip}
%\VignetteEncoding{UTF-8}
---

```{r ex_setup, include=FALSE}
Expand Down

0 comments on commit be1ffdb

Please sign in to comment.