Skip to content
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
44 changes: 25 additions & 19 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
^renv$
^renv\.lock$
CODE_OF_CONDUCT.md
SECURITY.md
# git
^\.git$
^\.github$
\.gitlab-ci\.yml$

# rstudio
^.*\.Rproj$
^\.Rproj\.user$
^_pkgdown\.yml$
^vignettes/hello\.Rmd$
^docs$
^\.github$
README.*
^\.lintr$
^staged_dependencies\.yaml$
coverage.*

# dev tools
^\.pre-commit-config\.yaml$
^codemeta\.json$
init.sh
workflows.md
images
^pkgdown$
^.revdeprefs\.yaml$
^revdep$
^\.lintr$
^\.covrignore$
^\.revdeprefs\.yaml$
^revdep$
^\.markdownlintignore$
^cran-comments\.md$

# pkgdown
^_pkgdown\.yml$
pkgdown
^pkgdown$

# docs
^docs$
LICENSE
^LICENSE\.md$
SECURITY
^SECURITY\.md$
2 changes: 2 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cran-comments.md
SECURITY.md
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ repos:
additional_dependencies:
- glue
- jsonlite
- roxygen2
- lzstring
- roxygen2
- stringr
Expand Down
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Type: Package
Package: roxy.shinylive
Title: A Roxygen2 Extension for Shinylive
Version: 0.0.0.9011
Title: A 'roxygen2' Extension for 'Shinylive'
Version: 1.0.0
Authors@R: c(
person("Pawel Rucki", , , "pawel.rucki@roche.com", role = c("aut", "cre")),
person("F. Hoffmann-La Roche AG", role = c("cph", "fnd"))
)
Description: An extension for roxygen2 that allows to auto-create links to
shinylive from examples in the documentation.
License: Apache License 2.0 | file LICENSE
Description: An extension for 'roxygen2' to embed 'Shinylive' applications
in the package documentation.
License: Apache License 2.0
URL: https://github.com/insightsengineering/roxy.shinylive/
BugReports: https://github.com/insightsengineering/roxy.shinylive/issues
Depends:
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# roxy.shinylive 0.0.0.9011
# roxy.shinylive 1.0.0

- Initialize the package.
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,33 @@

## Overview

This package provides a `roxygen2` extension that automatically takes the code from the `@examples` tag that follows and crate an URL to the shinylive service. During the documentation build, a new section is added to the function manual that contains aforementioned link as well as iframe to the application itself.
This package provides a `roxygen2` extension that automatically takes the code
from the `@examples` tag and create an URL to the
[shinylive.io](https://shinylive.io/) service.
During the documentation build, a new section is added to the function manual
that contains the aforementioned link as well as an iframe to the application itself.

### shinylive.io

[shinylive.io](https://shinylive.io/) is a service that allows you to run
[Shiny](https://shiny.posit.co/) applications entirely in the browser, without
a dedicated server.
It uses WebAssembly via [WebR](https://docs.r-wasm.org/webr/latest/).

It has a sharing feature that allows you to encode the application code in the
URL.
This package does such encoding and returns the URL which can be used in
variety of ways (from raw URL to iframe in function manual - see examples
below).

## Install

```r
install.packages("roxy.shinylive")
```

Alternatively, you might want to use the development version.

```r
# install.packages("pak")
pak::pak("insightsengineering/roxy.shinylive")
Expand Down Expand Up @@ -49,12 +72,12 @@ Which would produce a following output in your documentation:
\item{example-1}{
\href{https://shinylive.io/r/app/#code=...}{Open in Shinylive}
\if{html}{\out{<script type="text/javascript">(custom JS)</script>}}
\if{html}{\out{<iframe src="https://shinylive.io/r/app/#code=..."></iframe>}}
\if{html}{\out{<iframe class="iframe_shinylive" src="https://shinylive.io/r/app/#code=..."></iframe>}}
}
\item{example-2}{
\href{https://shinylive.io/r/app/#code=...}{Open in Shinylive}
\if{html}{\out{<script type="text/javascript">(custom JS)</script>}}
\if{html}{\out{<iframe src="https://shinylive.io/r/app/#code=..."></iframe>}}
\if{html}{\out{<iframe class="iframe_shinylive" src="https://shinylive.io/r/app/#code=..."></iframe>}}
}
...
}
Expand All @@ -74,6 +97,8 @@ Suggests:

Then in your vignette:

<!-- markdownlint-disable MD013 -->

````Rmd
```{r shinylive_url, echo = FALSE, results = 'asis'}
# extract the code from knitr code chunks by ID
Expand All @@ -92,8 +117,14 @@ knitr::include_url(url, height = "800px")
```
````

<!-- markdownlint-enable MD013 -->

![example of vignette](man/figures/vignette.gif)

See the package documentation for more details.

<!-- markdownlint-disable MD013 -->

See the example implementation in the [`teal.modules.general`](https://insightsengineering.github.io/teal.modules.general/) or [`teal.modules.clinical`](https://insightsengineering.github.io/teal.modules.clinical/) packages.

<!-- markdownlint-enable MD013 -->
54 changes: 54 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## Comments

#### 2024-11-21

Updates:
- Removed LICENSE file and its reference in the DESCRIPTION file.
- Used single quotes for package names etc.
- This package does not have any references to the academic publications hence no changes on that regard.
- Added README.md.

Please let me know if I can provide any more information.

Thank you,
Pawel

#### 2024-11-20

Thanks,

The LICENSE file is only needed if you have additional restrictions to
the license which you have not? In that case omit the file and its
reference in the DESCRIPTION file.

Please always write package names, software names and API (application
programming interface) names in single quotes in title and description.
e.g: --> 'roxygen2', ...
Please note that package names are case sensitive.

If there are references describing the methods in your package, please
add these in the description field of your DESCRIPTION file in the form
authors (year) <doi:...>
authors (year, ISBN:...)
or if those are not available: <https:...>
with no space after 'doi:', 'https:' and angle brackets for
auto-linking. (If you want to add a title as well please put it in
quotes: "Title")

Please fix and resubmit.

Best,
Benjamin Altmann

#### 2024-11-19

Initial submission.

## R CMD check results

0 errors | 0 warnings | 1 note

─ checking CRAN incoming feasibility ... [2s/15s] NOTE (15.3s)
Maintainer: ‘Pawel Rucki <pawel.rucki@roche.com>’

New submission
3 changes: 2 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Roxygen
Shinylive
WebAssembly
WebR
iframe
installable
io
roxy
roxygen
shinylive
Loading