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

Avoid adding the worksheet styling image on the CRAN vignette #1106

Merged
merged 2 commits into from
Aug 14, 2024
Merged
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ cran-comments.md
^inst/img$
^tests/testthat/_snaps$
^tests/testthat/testfiles$
vignettes/img/worksheet_styling.jpg
24 changes: 22 additions & 2 deletions vignettes/openxlsx2_style_manual.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,44 @@ vignette: >


```{r setup, include = FALSE}
library(openxlsx2)
options(rmarkdown.html_vignette.check_title = FALSE)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)

# Mechanism to avoid including all images in the package, but display them on
# the pkgdown site
in_pkgdown <- function() {
identical(Sys.getenv("IN_PKGDOWN"), "true")
}

incl_graph_in_pkgdown <- function(path) {
if (in_pkgdown()) {
knitr::include_graphics(path)
}
}
```

```{asis, echo=!in_pkgdown()}
You can read the [styling vignette](https://janmarvin.github.io/openxlsx2/articles/openxlsx2_style_manual.html) online to see images.
```


Welcome to the styling manual for `openxlsx2`. In this manual you will learn how to use `openxlsx2` to style your worksheets. data from xlsx-files to R as well as how to export data from R to xlsx, and how to import and modify these `openxml` workbooks in R.

```{r}
library(openxlsx2)
```

# Styling showcase

## Colors, text rotation and number formats

Below we show you two ways how to create styled tables with `openxlsx2` one using the high level functions to style worksheet areas and one using the bare metal approach of creating the identical table. We show both ways to create styles in `openxlsx2` to show how you could build on our functions or create your very own functions.

```{r echo=FALSE, warning=FALSE, out.width="100%", fig.cap="The example below, with increased column width."}
knitr::include_graphics("img/worksheet_styling.jpg")
incl_graph_in_pkgdown("img/worksheet_styling.jpg")
```

### the quick way: using high level functions
Expand Down
Loading