Skip to content

Commit

Permalink
Merge pull request #253 from RinteRface/pkgdown-webr
Browse files Browse the repository at this point in the history
Add webR in pkgdown
  • Loading branch information
DivadNojnarg authored Feb 29, 2024
2 parents fd4ee97 + 9a5ed92 commit d72b829
Show file tree
Hide file tree
Showing 102 changed files with 12,655 additions and 19,771 deletions.
32 changes: 12 additions & 20 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# NOTE: This workflow is overkill for most R packages and
# check-standard.yaml is likely a better choice.
# usethis::use_github_action("check-standard") will install it.
on:
push:
branches: [main, master]
Expand All @@ -23,35 +19,31 @@ jobs:
matrix:
config:
- {os: macOS-latest, r: 'release'}

- {os: windows-latest, r: 'release'}
# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, r: '3.6'}

# Use older ubuntu to maximise backward compatibility
- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-18.04, r: 'release'}
- {os: ubuntu-18.04, r: 'oldrel-1'}
- {os: ubuntu-18.04, r: 'oldrel-2'}
- {os: ubuntu-18.04, r: 'oldrel-3'}
- {os: ubuntu-18.04, r: 'oldrel-4'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '2.17.1' # The pandoc version to download (if necessary) and use.

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages:
any::rcmdcheck
extra-packages: |
rcmdcheck
needs: check
- uses: r-lib/actions/check-r-package@v2

- name: Show testthat output
Expand Down
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ License: GPL-2
Encoding: UTF-8
URL: https://github.com/RinteRface/shinyMobile, https://rinterface.github.io/shinyMobile/
BugReports: https://github.com/RinteRface/shinyMobile/issues
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Suggests:
knitr,
rmarkdown,
Expand All @@ -34,5 +34,6 @@ Suggests:
shinyWidgets,
apexcharter,
ggplot2,
dplyr
dplyr,
bslib
VignetteBuilder: knitr
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# shinyMobile 1.0.1.9000

## New
- Added webR to pkgdown infrastructure which allows to run shinylive
apps in the documentation.

## Minor change
- Add `limit` to `f7AutoComplete()`. Thanks @bthieurmel.

## Bug fixes
- Fix ignored __height__ in `f7Card()` (Typo).

# shinyMobile 1.0.0

## New
Expand Down
2 changes: 1 addition & 1 deletion R/f7Card.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ f7Card <- function(..., image = NULL, title = NULL, footer = NULL, outline = FAL

cardStyle <- NULL
if (!is.null(height)) {
style <- paste0("height: ", shiny::validateCssUnit(height), " overflow-y: auto;")
cardStyle <- paste0("height: ", shiny::validateCssUnit(height), "; overflow-y: auto;")
}

# content
Expand Down
33 changes: 33 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,36 @@ get_args <- function(level) {
cl <- match.call(definition=f, call=cl)
as.list(cl)[-1]
}

#' Create shinylive iframe
#'
#' @param app_code base64 app code. You can create it from https://shinylive.io/r
#' by writing code and click on share and copy the link. The code is located at
#' the end of the url.
#' @param mode How to display the shinylive app. Default to app mode.
#' @param header Whether to display the shinylive header. Default to TRUE.
#'
#' @keywords internal
create_app_link <- function(app_code, mode = c("app", "editor"), header = TRUE) {
mode <- match.arg(mode)

app_url <- sprintf(
"https://shinylive.io/r/%s/#code=%s", mode, app_code
)

if (!header) {
app_url <- paste0(app_url, "&h=0")
}

shiny::tags$iframe(
# To allow the content to fill the full screen card
class = "html-fill-item",
src = app_url,
height = "700",
width = "100%",
style = "border: 1px solid rgba(0,0,0,0.175); border-radius: .375rem;",
allowfullscreen = "",
allow = "autoplay",
`data-external` = "1"
)
}
15 changes: 11 additions & 4 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,17 @@ reference:


template:
params:
bootswatch: readable


bootstrap: 5
bslib:
info: "#E6F2FD"
pkgdown-nav-height: 100px
includes:
in_header: >
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/atropos.min.css">
navbar:
bg: info
type: light

news:
releases:
Expand Down
Loading

0 comments on commit d72b829

Please sign in to comment.