-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Christophe Dervieux <[email protected]>
- Loading branch information
Showing
13 changed files
with
164 additions
and
21 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: quarto | ||
Title: R Interface to 'Quarto' Markdown Publishing System | ||
Version: 1.3.2 | ||
Version: 1.3.3 | ||
Authors@R: c( | ||
person("JJ", "Allaire", , "[email protected]", role = c("aut", "cre"), | ||
comment = c(ORCID = "0000-0003-0174-9868")), | ||
|
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
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,9 @@ | ||
cli_arg_profile <- function(profile, ...) { | ||
arg <- c("--profile", paste0(profile, collapse = ",")) | ||
append_cli_args(arg, ...) | ||
} | ||
|
||
append_cli_args <- function(new, append_to = NULL, after = length(append_to)) { | ||
if (!is.null(append_to)) return(append(append_to, new, after)) | ||
new | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,2 @@ | ||
execute: | ||
echo: true |
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
project: | ||
type: site | ||
|
||
execute: | ||
echo: false |
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 |
---|---|---|
@@ -1,11 +1,22 @@ | ||
test_that("R Markdown documents can be inspected", { | ||
test_that("Documents can be inspected", { | ||
skip_if_no_quarto() | ||
metadata <- quarto_inspect("test.Rmd") | ||
metadata <- quarto_inspect(test_path("test.Rmd")) | ||
expect_type(metadata$formats, "list") | ||
metadata <- quarto_inspect(test_path("test.qmd")) | ||
expect_type(metadata$formats, "list") | ||
metadata <- quarto_inspect(test_path("test.ipynb")) | ||
expect_type(metadata$formats, "list") | ||
}) | ||
|
||
test_that("Quarto projects can be inspected", { | ||
skip_if_no_quarto() | ||
metadata <- quarto_inspect("project") | ||
metadata <- quarto_inspect(test_path("project")) | ||
expect_type(metadata$config, "list") | ||
}) | ||
|
||
test_that("Quarto projects can be inspected with profile", { | ||
skip_if_no_quarto() | ||
metadata <- quarto_inspect(test_path("project"), "test") | ||
expect_type(metadata$config, "list") | ||
expect_identical(metadata$config$execute$echo, TRUE) | ||
}) |
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,13 @@ | ||
test_that("append to existing", { | ||
expect_identical(append_cli_args("a"), "a") | ||
expect_identical(append_cli_args(c("a", "b")), c("a", "b")) | ||
expect_identical(append_cli_args("c", c("a", "b")), c("a", "b", "c")) | ||
expect_identical(append_cli_args("b", c("a", "c"), 1), c("a", "b", "c")) | ||
expect_identical(append_cli_args(c("b","c"), c("a", "d"), 1), c("a", "b", "c", "d")) | ||
}) | ||
|
||
test_that("create profile arg", { | ||
expect_identical(cli_arg_profile("a"), c("--profile", "a")) | ||
expect_identical(cli_arg_profile(c("a", "b")), c("--profile", "a,b")) | ||
expect_identical(cli_arg_profile(c("a", "b"), "input.qmd"), c("input.qmd", "--profile", "a,b")) | ||
}) |
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,49 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "raw", | ||
"metadata": {}, | ||
"source": [ | ||
"---\n", | ||
"title: \"Untitled\"\n", | ||
"format: html\n", | ||
"---" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Quarto\n", | ||
"\n", | ||
"Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.\n", | ||
"\n", | ||
"## Running Code\n", | ||
"\n", | ||
"When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:\n", | ||
"\n", | ||
"```{r}\n", | ||
"1 + 1\n", | ||
"```\n", | ||
"\n", | ||
"You can add options to executable code like this\n", | ||
"\n", | ||
"```{r}\n", | ||
"#| echo: false\n", | ||
"2 * 2\n", | ||
"```\n", | ||
"\n", | ||
"The `echo: false` option disables the printing of code (only output is displayed)." | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"name": "python3", | ||
"language": "python", | ||
"display_name": "Python 3 (ipykernel)" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 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,25 @@ | ||
--- | ||
title: "Untitled" | ||
format: html | ||
--- | ||
|
||
## Quarto | ||
|
||
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>. | ||
|
||
## Running Code | ||
|
||
When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this: | ||
|
||
```{r} | ||
1 + 1 | ||
``` | ||
|
||
You can add options to executable code like this | ||
|
||
```{r} | ||
#| echo: false | ||
2 * 2 | ||
``` | ||
|
||
The `echo: false` option disables the printing of code (only output is displayed). |