Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Golem doc #1160

Draft
wants to merge 16 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ jobs:
extra-packages: any::pkgdown, local::.
needs: website

- name: Install thinkrtemplate
run: install.packages("remotes");remotes::install_github("ThinkR-open/thinkrtemplate")
shell: Rscript {0}

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
139 changes: 49 additions & 90 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,143 +23,102 @@ link_to_branch_svg <- paste0(
"https://codecov.io/gh/ThinkR-open/golem/branch/",
name_branch,
"/graph/badge.svg"
)
)
link_to_branch_html <- paste0(
"https://app.codecov.io/github/ThinkR-open/golem/tree/",
name_branch
)
)
```

![](https://img.shields.io/badge/r%20package-%23276DC3.svg?style=for-the-badge&logo=r)

[![CRAN](https://www.r-pkg.org/badges/version/golem)](https://cran.r-project.org/package=golem)
[![downloads monthly](https://cranlogs.r-pkg.org/badges/golem)](https://CRAN.R-project.org/package=golem)
[![downloads total](https://cranlogs.r-pkg.org/badges/grand-total/golem)](https://CRAN.R-project.org/package=golem)

```{r, echo = FALSE, results = "asis"}
cat('[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)')
cat('[![R-CMD-check](https://github.com/ThinkR-open/golem/workflows/R-CMD-check/badge.svg)](https://github.com/ThinkR-open/golem/actions)')
cat("[![R-CMD-check](https://github.com/ThinkR-open/golem/workflows/R-CMD-check/badge.svg)](https://github.com/ThinkR-open/golem/actions)")
cat("")
cat(paste0("\n[![Coverage status](", link_to_branch_svg, ")](", link_to_branch_html, ")"))
cat('[![CRAN status](https://www.r-pkg.org/badges/version/golem)](https://cran.r-project.org/package=golem)')
```

<!-- badges: end -->
<!-- badges: end -->

# {golem} <img src="https://raw.githubusercontent.com/ThinkR-open/golem/master/inst/rstudio/templates/project/golem.png" align="right" width="120"/>

`{golem}` is an opinionated framework for building production-grade shiny applications.
`Golem` is an opinionated framework for building production-grade shiny applications.
It is designed to help you build robust, maintainable shiny apps, with a consistent structure and workflow.

This package helps you to:

- **Build** a shiny application with a solid foundation inside a package,
- **Develop** your application in a robust and scalable way,
- **Test** your application with a set of tools and best practices,
- **Deploy** your application in a production-ready environment.

## Installation

- You can install the stable version from CRAN with:
You can install the stable version from CRAN with:

``` r
install.packages("golem")
```

- You can install the development version from [GitHub](https://github.com/Thinkr-open/golem) with:
You can install the development version from [GitHub](https://github.com/Thinkr-open/golem) with:

``` r
# install.packages("remotes")
remotes::install_github("Thinkr-open/golem") # very close to CRAN version
# remotes::install_github("Thinkr-open/golem@dev") # if you like to play
remotes::install_github("Thinkr-open/golem")
```

## Resources

The `{golem}` package is part of the [`{golemverse}`](https://golemverse.org/), a series of tools for Shiny.
A list of various `{golem}` related resources (tutorials, video, blog post,...) can be found [here](https://golemverse.org/resources/).
## Create a new application with `golem`

### With RStudio

## Launch the project
If you are developping in RStudio, you can use the `golem` RStudio addin to create a new application.

Create a new package with the project template:
Go to `File` > `New Project` > `New Directory` > Search for `Package for Shiny App using golem`:

```{r, echo=FALSE, out.width="80%", eval=TRUE}
knitr::include_graphics("https://raw.githubusercontent.com/ThinkR-open/golem/master/inst/img/golemtemplate.png")
knitr::include_graphics("man/figures/golemtemplate.png")
```

## Step by step guide

See full documentation in the `{pkgdown}` website:

[CRAN] <https://thinkr-open.github.io/golem/>

[dev] <https://thinkr-open.github.io/golem/dev/>

After project creation, you'll land on `dev/01_start.R`. There are also `dev/02_dev.R` and `dev/03_deploy.R`

These files are used to keep a track of all the steps you'll be following while building your app.

### Step 1 : Getting Started

Read [the Getting Started](https://thinkr-open.github.io/golem/articles/a_start.html) Vignette for a detailed walkthrough.

### Step 2 : Day to Day Dev

Read [Day to Day Dev](https://thinkr-open.github.io/golem/articles/b_dev.html) Vignette for a detailed walkthrough.

### Step 3: deploy
### With R

Read [Deploying Apps with {golem}](https://thinkr-open.github.io/golem/articles/c_deploy.html) Vignette for a detailed walkthrough.
You can also create a new application with the following R code:

```{r eval = FALSE}
golem::create_golem("mygolemapp")
```

## Tool series

This package is part of a series of tools for Shiny, which includes:

- `{golem}` - <https://github.com/ThinkR-open/golem>
- `{shinipsum}` - <https://github.com/ThinkR-open/shinipsum>
- `{fakir}` - <https://github.com/ThinkR-open/fakir>
- `{gemstones}` - <https://github.com/ThinkR-open/gemstones>

## Examples apps

These are examples from the community. Please note that they may not necessarily be written in a canonical fashion and may have been written with different versions of `{golem}` or `{shiny}`.

- <https://github.com/seanhardison1/vcrshiny>
- <https://github.com/Nottingham-and-Nottinghamshire-ICS/healthcareSPC>
- <https://github.com/marton-balazs-kovacs/tenzing>
- <https://github.com/shahreyar-abeer/cranstars>

You can also find apps at:

- <https://connect.thinkr.fr/connect/>
- <https://github.com/ColinFay/golemexamples>
Run this code in your R console will create a new golem application in a folder called `mygolemapp` where you run the code.

## About
A new Rstudio window will open with the new project.

You're reading the doc about version: `r pkgload::pkg_version()`
## Launch your app

This `README` has been compiled on the
Once your project is created, you can run your app with the following code:

```{r}
Sys.time()
```{r eval = FALSE}
golem::run_dev()
```

Here are the test & coverage results:

```{r error = TRUE}
devtools::check(quiet = TRUE)
```
Enjoy your new app!

```{r echo = FALSE}
unloadNamespace("golem")
```
## Play with golem

```{r error = TRUE}
covr::package_coverage()
```
### Your very first time with golem

## CoC
You can find find a full tutorial on how to create your first `golem` app [here](x).

Please note that this project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html). By participating in this project you agree to abide by its terms.
A lot of resources are available to help you get started with `golem` [here](x).

### Contribute

## Note for the contributors
You love `golem` and want to contribute? Check out our documentation on how to contribute [here](x).

Please style the files according to `grkstyle::grk_style_transformer()`

```{r eval = FALSE}
# If you work in RStudio
options(styler.addins_style_transformer = "grkstyle::grk_style_transformer()")
## Code of Conduct

# If you work in VSCode
options(languageserver.formatting_style = function(options) {
grkstyle::grk_style_transformer()
})
```
Please note that this project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html).
By participating in this project you agree to abide by its terms.
Loading
Loading