inst/test.md

Include a markdown file first

We can have sections

And they even stack properly.

Subsections

And lists:

Links: This is URL, maybe also links to functions: processx::poll().

roxygen2 style links do not work in markdown unfortunately. They do work in the manual, though: processx::poll().

And some code:

eval_rmd <- function(path, output_format = rmarkdown::github_document(),
                       ...) {
  md_path <- tempfile(fileext = ".md")
  on.exit(unlink(md_path, recursive = TRUE), add = TRUE)
  rmarkdown::render(path, output_format = output_format,
                    output_file = md_path, ...)
  eval_md(md_path)
}

We can run some R code as well:

fib <- function(n) {
  if (n == 0) {
    0
  } else if (n == 1) {
    1
  } else {
    fib(n - 1) + fib(n - 2)
  }
}
fib(1)

## [1] 1

fib(5)

## [1] 5

Now incluce an Rmd file

We can have sections

And they even stack properly.

Subsections

And lists:

Links: This is URL, maybe also links to functions: processx::poll().

roxygen2 style links do not work in markdown unfortunately. They do work in the manual, though: processx::poll().

And some code:

eval_rmd <- function(path, output_format = rmarkdown::github_document(),
                       ...) {
  md_path <- tempfile(fileext = ".md")
  on.exit(unlink(md_path, recursive = TRUE), add = TRUE)
  rmarkdown::render(path, output_format = output_format,
                    output_file = md_path, ...)
  eval_md(md_path)
}

We can run some R code as well:

fib <- function(n) {
  if (n == 0) {
    0
  } else if (n == 1) {
    1
  } else {
    fib(n - 1) + fib(n - 2)
  }
}
fib(1)
## [1] 1
fib(5)
## [1] 5

Some more text…



gaborcsardi/rmd2rd documentation built on Nov. 4, 2019, 1:01 p.m.