-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ba8f5c0
Showing
15 changed files
with
777 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Java CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: [ 'v*.*' ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
java: [ 8 ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
java-package: jdk | ||
- run: | | ||
WD=$PWD | ||
cd .. | ||
git clone https://github.com/Funz/funz-profile | ||
cd $WD | ||
shell: bash | ||
- run: ant -noinput -buildfile build.xml test | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
java-package: jdk | ||
- run: | | ||
WD=$PWD | ||
cd .. | ||
git clone https://github.com/Funz/funz-profile | ||
cd $WD | ||
- run: | | ||
ant clean dist | ||
cd dist; zip -r ../plugin-Rmd.zip *; cd .. | ||
ant install | ||
zip -r Funz-Rmd.zip Funz-Rmd | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: dist | ||
- uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: ./*-Rmd.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/**/*-private | ||
/**/log.txt | ||
/**/*history | ||
|
||
/build/ | ||
/tmp/ | ||
/nbproject/ | ||
/dist/ | ||
/test/ | ||
|
||
/*.png | ||
/*.html | ||
/*.log | ||
/*.zip | ||
/*.out | ||
/*.csv | ||
/*.txt | ||
/*.Rout | ||
/*.Rdata | ||
/*.Rmd | ||
/*.exec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[![.github/workflows/ant.yml](https://github.com/Funz/plugin-Rmd/actions/workflows/ant.yml/badge.svg)](https://github.com/Funz/plugin-Rmd/actions/workflows/ant.yml) | ||
|
||
# Funz plugin: Rmd | ||
|
||
This plugin is dedicated to launch RMarkDown rendering from Funz. | ||
It supports the following syntax and features: | ||
|
||
* Input | ||
* file type supported: *.Rmd, any other format for resources | ||
* parameter syntax: | ||
* variable syntax: `?[...]` | ||
* formula syntax: `!{...}` | ||
* comment char: `/` | ||
* example input file: | ||
``` | ||
--- | ||
title: "Untitled" | ||
--- | ||
we set x1 to ?[x1~[1,2]] | ||
we set x2 to ?x2 | ||
mean_speed=`r mean(cars$speed) + !{?x2 + 1.23 | #.###}` | ||
``` | ||
* will identify input: | ||
* x1, expected to vary inside [1,2] | ||
* x2, expected to vary inside [0,1] (by default) | ||
* replace `!{?x2 + 1.23 | #.###}` expression by its evaluation | ||
|
||
* Output | ||
* file type supported: *.html | ||
* read any named value printed with '=`r ...', like | ||
* example output file: | ||
``` | ||
... | ||
<p>mean_speed=15.4</p> | ||
... | ||
``` | ||
* will return output: | ||
* mean_speed=15.4 | ||
|
||
|
||
|
||
![Analytics](https://ga-beacon.appspot.com/UA-109580-20/plugin-Rmd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<project name="plugin-Rmd" default="test" basedir="."> | ||
|
||
<property name="code.name" value="Rmd" /> | ||
<property name="install.dir" value="${basedir}/Funz-${code.name}" /> | ||
|
||
<property name="build_plugin.xml" location="../funz-profile/build_plugin.xml" /> | ||
<import file="${build_plugin.xml}"/> | ||
|
||
<target name="dist" depends="dist-ioplugin"/> <!-- dist-ioplugin: copy just the plugin ascii files --> | ||
|
||
<target name="test" depends="test-ioplugin"/> <!-- test-ioplugin: test the plugin ascii files --> | ||
|
||
<target name="install" depends="install-plugin"/> <!-- test-ioplugin: test the plugin ascii files --> | ||
|
||
<target name="super.clean" depends="clean"/> | ||
<target name="super.run-reference-cases" depends="run-reference-cases"/> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
variableStartSymbol=? | ||
variableLimit=[...] | ||
formulaStartSymbol=! | ||
formulaLimit={...} | ||
commentLineChar=# | ||
|
||
datasetFilter=contains("(.*)","cat\\(") & contains("(.*)","---") | ||
|
||
outputlist=`grep("(.*)Rmd","^(.*)=.r\\s")>>before("=")` | ||
|
||
output.???.get=lines("(.*)html") >> filter("^<p>???=(.*)</p>$") >> after("=") >> before("<") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: "Untitled" | ||
author: "IRSN / Y. Richet" | ||
date: '2022-04-28' | ||
output: html_document | ||
--- | ||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(echo = TRUE) | ||
``` | ||
|
||
## R Markdown | ||
|
||
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. | ||
|
||
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: | ||
|
||
```{r cars} | ||
summary(cars) | ||
``` | ||
|
||
## Including Plots | ||
|
||
You can also embed plots, for example: | ||
|
||
```{r pressure, echo=FALSE} | ||
plot(pressure) | ||
``` | ||
|
||
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot. | ||
|
||
## Results | ||
|
||
Funz parse Rmd numerical output using the syntax of inline Rmd on a new line: | ||
|
||
mean_speed=`r mean(cars$speed)` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@echo off | ||
|
||
set PATH=%PATH%;C:\Program Files\R\R-4.1.0\bin | ||
|
||
set id=%RANDOM% | ||
start "Rmd_%id%" cmd /c "Rscript.exe -e ""rmarkdown::render('%1', output_format = 'html_document',output_file = '%1.html', encoding='UTF-8')"" > Rmd.Rout" | ||
set PID_R="none" | ||
for /F "TOKENS=1,2,*" %%a in ('tasklist /FI "WINDOWTITLE eq Rmd_%id%"') do set PID_R=%%b | ||
echo %PID_R% > PID | ||
|
||
if "%PID_R%" neq "none" ( | ||
:loop | ||
tasklist | findstr " %PID_R% " >nul | ||
if not errorlevel 1 ( | ||
timeout /t 1 >nul | ||
goto :loop | ||
) | ||
) | ||
|
||
del /f PID | ||
|
||
if not exist "*.Rout" ( | ||
exit 2 | ||
) | ||
findstr "Err" *.Rout | ||
if not errorlevel 1 ( | ||
exit 1 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
Rscript -e "rmarkdown::render('$1', output_format = 'html_document',output_file = '$1.html', encoding='UTF-8')" > Rmd.Rout & | ||
PID_R=$! | ||
echo $PID_R >> PID #this will allow Funz to kill process if needed | ||
|
||
wait $PID_R | ||
|
||
rm -f PID | ||
|
||
ERROR=`tail -2 *.Rout | grep "Err"` | ||
if [ ! "$ERROR" == "" ]; then | ||
echo $ERROR >&2 | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#Thu Apr 28 18:43:15 CEST 2022 | ||
duration=0 | ||
output={mean_speed\=15.4} | ||
output.mean_speed=15.4 | ||
code=Rmd | ||
input.No\ name=No value | ||
start=18\:43\:14 | ||
end= | ||
state=running | ||
calc=localhost\:41909 | ||
info=Results parsed\: {1\=1.0, mean_speed\=15.4} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: "Untitled" | ||
author: "IRSN / Y. Richet" | ||
date: '2022-04-28' | ||
output: html_document | ||
--- | ||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(echo = TRUE) | ||
``` | ||
|
||
## R Markdown | ||
|
||
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. | ||
|
||
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: | ||
|
||
```{r cars} | ||
summary(cars) | ||
``` | ||
|
||
## Including Plots | ||
|
||
You can also embed plots, for example: | ||
|
||
```{r pressure, echo=FALSE} | ||
plot(pressure) | ||
``` | ||
|
||
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot. | ||
|
||
## Results | ||
|
||
Funz parse Rmd numerical output using the syntax of inline Rmd on a new line: | ||
|
||
mean_speed=`r mean(cars$speed)` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: "Untitled" | ||
author: "IRSN / Y. Richet" | ||
date: '2022-04-28' | ||
output: html_document | ||
--- | ||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(echo = TRUE) | ||
``` | ||
|
||
## R Markdown | ||
|
||
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. | ||
|
||
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: | ||
|
||
```{r cars} | ||
summary(cars) | ||
``` | ||
|
||
## Including Plots | ||
|
||
You can also embed plots, for example: | ||
|
||
```{r pressure, echo=FALSE} | ||
plot(pressure) | ||
``` | ||
|
||
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot. | ||
|
||
## Results | ||
|
||
Funz parse Rmd numerical output using the syntax of inline Rmd on a new line: | ||
|
||
mean_speed=`r mean(cars$speed)` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
processing file: Untitled.Rmd | ||
output file: Untitled.knit.md | ||
|
||
|
||
Output created: Untitled.Rmd.html |
Empty file.