Skip to contents

Currently only supports conversion of rmd_tibble objects back to rmd_ast.

Usage

as_ast(x, ...)

Arguments

x

Object to convert

...

Unused, for extensibility.

Value

Returns an rmd_ast object.

Examples

parse_rmd(system.file("examples/hw01.Rmd", package="parsermd")) %>%
  as_tibble() %>%
  as_ast()
#> ├── YAML [2 fields]
#> ├── Heading [h3] - Load packages
#> │   └── Chunk [r, 1 option, 2 lines] - load-packages
#> ├── Heading [h3] - Exercise 1
#> │   ├── Markdown [2 lines]
#> │   └── Heading [h4] - Solution
#> │       └── Markdown [2 lines]
#> ├── Heading [h3] - Exercise 2
#> │   ├── Markdown [2 lines]
#> │   └── Heading [h4] - Solution
#> │       ├── Markdown [4 lines]
#> │       ├── Chunk [r, 2 options, 5 lines] - plot-dino
#> │       ├── Markdown [2 lines]
#> │       └── Chunk [r, 0 options, 2 lines] - cor-dino
#> └── Heading [h3] - Exercise 3
#>     ├── Markdown [2 lines]
#>     └── Heading [h4] - Solution
#>         ├── Markdown [4 lines]
#>         ├── Chunk [r, 0 options, 1 line] - plot-star
#>         ├── Markdown [2 lines]
#>         └── Chunk [r, 0 options, 1 line] - cor-star