Skip to content
Snippets Groups Projects
Commit 5368f098 authored by jens.preussner's avatar jens.preussner :ghost:
Browse files

Merge branch 'ymlthis' into 'master'

Resolved Ymlthis issue

See merge request !6
parents 610a3960 b1635cf5
Branches
No related tags found
1 merge request!6Resolved Ymlthis issue
Pipeline #120826 passed
...@@ -3,4 +3,5 @@ r-base ...@@ -3,4 +3,5 @@ r-base
r-flexdashboard r-flexdashboard
r-knitr r-knitr
r-yaml r-yaml
r-ymlthis
zip zip
\ No newline at end of file
...@@ -18,7 +18,8 @@ Imports: ...@@ -18,7 +18,8 @@ Imports:
yaml, yaml,
assertive.sets, assertive.sets,
stringr, stringr,
glue glue,
ymlthis
Suggests: Suggests:
highcharter, highcharter,
plotly, plotly,
......
...@@ -20,13 +20,13 @@ setMethod("assemble", "i2dashboard", function(dashboard, pages = names(dashboard ...@@ -20,13 +20,13 @@ setMethod("assemble", "i2dashboard", function(dashboard, pages = names(dashboard
} }
# Add YAML header # Add YAML header
knitr::knit_expand(file = system.file("templates", "yaml_header.Rmd", package = "i2dash"), options(ymlthis.rmd_body = "")
delim = c("<%", "%>"), ymlthis::yml(date = F) %>%
title = dashboard@title, ymlthis::yml_title(dashboard@title) %>%
author = dashboard@author, ymlthis::yml_author(dashboard@author) %>%
theme = dashboard@theme, ymlthis::yml_output(flexdashboard::flex_dashboard(theme = dashboard@theme)) %>%
interactive = dashboard@interactive) %>% {if(dashboard@interactive) ymlthis::yml_runtime(., runtime = "shiny") else .} %>%
cat(file = tmp_document, append = FALSE, sep = "\n") ymlthis::use_rmarkdown(path = tmp_document, include_body = FALSE, quiet = TRUE, open_doc = FALSE)
# Add i2dash global setup # Add i2dash global setup
knitr::knit_expand(file = system.file("templates", "i2dash-global-setup.Rmd", package = "i2dash"), knitr::knit_expand(file = system.file("templates", "i2dash-global-setup.Rmd", package = "i2dash"),
...@@ -67,6 +67,7 @@ setMethod("assemble", "i2dashboard", function(dashboard, pages = names(dashboard ...@@ -67,6 +67,7 @@ setMethod("assemble", "i2dashboard", function(dashboard, pages = names(dashboard
warning(sprintf("i2dashboard dashboard does not contain a page named '%s'", pagename)) warning(sprintf("i2dashboard dashboard does not contain a page named '%s'", pagename))
} }
} }
# copy tempfile to final_document # copy tempfile to final_document
file.copy(from = tmp_document, to = file, overwrite = TRUE) file.copy(from = tmp_document, to = file, overwrite = TRUE)
...@@ -114,4 +115,5 @@ setMethod("assemble", "i2dashboard", function(dashboard, pages = names(dashboard ...@@ -114,4 +115,5 @@ setMethod("assemble", "i2dashboard", function(dashboard, pages = names(dashboard
sidebar = sidebar, sidebar = sidebar,
components = components, components = components,
date = Sys.time()) date = Sys.time())
} }
\ No newline at end of file
---
title: <% title %>
author: <% author %>
output:
flexdashboard::flex_dashboard:
theme: <% theme %>
<% if(interactive) sprintf('runtime: shiny') %>
---
<!-- This dashboard was created with the R package 'i2dash'. https://gitlab.gwdg.de/loosolab/software/i2dash -->
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment