Skip to content

Commit

Permalink
migrate: Rmd bookdown -> Quarto book
Browse files Browse the repository at this point in the history
  • Loading branch information
bbest committed Nov 6, 2024
1 parent fbbfda3 commit cf55e8b
Show file tree
Hide file tree
Showing 28 changed files with 229 additions and 41 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
workflow_dispatch:
push:
branches: main

name: Quarto Publish

jobs:
build-deploy:
runs-on: macOS-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install librsvg (svg for pdf)
run: brew install librsvg

- name: Install Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Install TinyTex (pdf)
uses: r-lib/actions/setup-tinytex@v2

- name: Install headless chromium (mmd -> img)
run: quarto install chromium

- name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.4.0'

- name: Install R Dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2

- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ _publish.R
_book
_bookdown_files
rsconnect
/.quarto/
.DS_Store
3 changes: 0 additions & 3 deletions 06-references.Rmd

This file was deleted.

26 changes: 20 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Package: placeholder
Type: Book
Title: Does not matter.
Version: 0.0.1
Imports: bookdown
Remotes: rstudio/bookdown
Package: docs
Title: Documentation for Marine Energy Toolkit
Version: 0.0.0.9000
Authors@R:
person("Ben", "Best", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-2686-0784"))
Description: What the package does (one paragraph).
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Imports:
dplyr,
glue,
here,
knitr,
librarian,
quarto,
stringr,
yaml
54 changes: 54 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
project:
type: book
# pre-render: lib/pre-render.R
output-dir: _book
resources:
- "/.nojekyll"

book:
title: "MEtkit Help"
subtitle: "Marine Energy Toolkit Help"
description: "Help documentation to set up, maintain, and use the Marine Energy Toolkit"
author:
- name: Benjamin D. Best
orcid: 0000-0002-2686-0784
email: [email protected]
affiliations:
- name: EcoQuants LLC
state: CA
date: today
date-format: "YYYY-MM-DD"
site-url: https://marineenergy.github.io/help/
repo-url: https://github.com/marineenergy/help/
repo-actions: [edit]
downloads: [pdf, docx]
sharing: [twitter, facebook, linkedin]
# google-analytics: "G-V3HZN14Z8G" # TODO: add Google Analytics
search: true
page-navigation: true
chapters:
- index.qmd
- sysadmins.qmd
- rtech.qmd
- community.qmd
- application.qmd
- summary.qmd
#- references.qmd

bibliography: ["refs/book.bib", "refs/packages.bib"]
bibliographystyle: apa
link-citations: true

format:
html:
theme: cosmo
toc: true
number-sections: true
pdf:
documentclass: scrreprt
# keep-tex: true # for debugging
docx: default




File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions mhk-env_help.Rproj → help.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: knitr
RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Website
20 changes: 4 additions & 16 deletions index.Rmd → index.qmd
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
---
title: "A Minimal Book Example"
author: "Yihui Xie"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
output: bookdown::gitbook
documentclass: book
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
github-repo: rstudio/bookdown-demo
description: "This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook."
---
# How to use the help documentation:
# Welcome

## How to use the help documentation:
This help documentation is organized by role, including System Administrators (sysadmins), RShiny Application developers (rtech), and community users (community). Information related to corresponding workflows are located in each section of the help documentation.

For information related to server setup and location please refer to the sysadmins section of the documentation. For application development methods and existing workflows to update the application please refer to the rtech section of the help. In order to understand how to contribute to the application as a part of the user community please refer to the community section of the documentation.


# Prerequisites
## Prerequisites

This is a _sample_ book written in **Markdown**. You can use anything that Pandoc's Markdown supports, e.g., a math equation $a^2 + b^2 = c^2$.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 13 additions & 12 deletions packages.bib
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,32 @@ @Manual{R-base
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2021},
year = {2024},
url = {https://www.R-project.org/},
}

@Manual{R-bookdown,
title = {bookdown: Authoring Books and Technical Documents with R Markdown},
author = {Yihui Xie},
year = {2021},
note = {https://github.com/rstudio/bookdown},
year = {2024},
note = {R package version 0.40},
url = {https://github.com/rstudio/bookdown},
}

@Manual{R-knitr,
title = {knitr: A General-Purpose Package for Dynamic Report Generation in R},
author = {Yihui Xie},
year = {2021},
note = {R package version 1.36},
year = {2024},
note = {R package version 1.48},
url = {https://yihui.org/knitr/},
}

@Manual{R-rmarkdown,
title = {rmarkdown: Dynamic Documents for R},
author = {JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone},
year = {2021},
note = {https://github.com/rstudio/rmarkdown},
author = {JJ Allaire and Yihui Xie and Christophe Dervieux and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone},
year = {2024},
note = {R package version 2.28},
url = {https://github.com/rstudio/rmarkdown},
}

@Book{bookdown2016,
Expand All @@ -35,7 +37,7 @@ @Book{bookdown2016
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2016},
note = {ISBN 978-1138700109},
isbn = {978-1138700109},
url = {https://bookdown.org/yihui/bookdown},
}

Expand All @@ -58,7 +60,6 @@ @InCollection{knitr2014
publisher = {Chapman and Hall/CRC},
year = {2014},
note = {ISBN 978-1466561595},
url = {http://www.crcpress.com/product/isbn/9781466561595},
}

@Book{rmarkdown2018,
Expand All @@ -67,7 +68,7 @@ @Book{rmarkdown2018
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2018},
note = {ISBN 9781138359338},
isbn = {9781138359338},
url = {https://bookdown.org/yihui/rmarkdown},
}

Expand All @@ -77,7 +78,7 @@ @Book{rmarkdown2020
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2020},
note = {ISBN 9780367563837},
isbn = {9780367563837},
url = {https://bookdown.org/yihui/rmarkdown-cookbook},
}

4 changes: 4 additions & 0 deletions references.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# References {.unnumbered}

::: {#refs}
:::
File renamed without changes.
83 changes: 83 additions & 0 deletions refs/packages.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
@Manual{R-base,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2021},
url = {https://www.R-project.org/},
}

@Manual{R-bookdown,
title = {bookdown: Authoring Books and Technical Documents with R Markdown},
author = {Yihui Xie},
year = {2021},
note = {https://github.com/rstudio/bookdown},
}

@Manual{R-knitr,
title = {knitr: A General-Purpose Package for Dynamic Report Generation in R},
author = {Yihui Xie},
year = {2021},
note = {R package version 1.36},
url = {https://yihui.org/knitr/},
}

@Manual{R-rmarkdown,
title = {rmarkdown: Dynamic Documents for R},
author = {JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone},
year = {2021},
note = {https://github.com/rstudio/rmarkdown},
}

@Book{bookdown2016,
title = {bookdown: Authoring Books and Technical Documents with {R} Markdown},
author = {Yihui Xie},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2016},
note = {ISBN 978-1138700109},
url = {https://bookdown.org/yihui/bookdown},
}

@Book{knitr2015,
title = {Dynamic Documents with {R} and knitr},
author = {Yihui Xie},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2015},
edition = {2nd},
note = {ISBN 978-1498716963},
url = {https://yihui.org/knitr/},
}

@InCollection{knitr2014,
booktitle = {Implementing Reproducible Computational Research},
editor = {Victoria Stodden and Friedrich Leisch and Roger D. Peng},
title = {knitr: A Comprehensive Tool for Reproducible Research in {R}},
author = {Yihui Xie},
publisher = {Chapman and Hall/CRC},
year = {2014},
note = {ISBN 978-1466561595},
url = {http://www.crcpress.com/product/isbn/9781466561595},
}

@Book{rmarkdown2018,
title = {R Markdown: The Definitive Guide},
author = {Yihui Xie and J.J. Allaire and Garrett Grolemund},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2018},
note = {ISBN 9781138359338},
url = {https://bookdown.org/yihui/rmarkdown},
}

@Book{rmarkdown2020,
title = {R Markdown Cookbook},
author = {Yihui Xie and Christophe Dervieux and Emily Riederer},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2020},
note = {ISBN 9780367563837},
url = {https://bookdown.org/yihui/rmarkdown-cookbook},
}

5 changes: 4 additions & 1 deletion 02-rtech.Rmd → rtech.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

## Updating dynamic content

- [Interactions]: re-knit env.Rmd.
TODO:

- Interactions: re-knit env.Rmd.

### Shiny App Content Updates

To render changes made to content in a Shiny app, navigate to the folder that contains the application files to run the app. Shiny apps are served from a standard folder where they are symbolically linked to source files. These folders contain the global.R, ui.R, server.R scripts that run the app.

- global.R: functions used in ui.R and server.R can be defined here, sourced here from other files or in loaded libraries
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit cf55e8b

Please sign in to comment.