get_TextType: get_TextType

Description Usage Arguments Value Examples

View source: R/get_TextType.R

Description

Render a TextType node int HTML or some other format

Usage

1
2
get_TextType(node, to = "html", output = tempfile(class(node), fileext
  = paste0(".", to)), view = TRUE)

Arguments

node

any TextType node

to

desired format, default is html, but can be any type supported by pandoc (docx, md, etc)

output

name of the desired output file

view

if HTML, do we want to open result in browser?

Value

creates a file requested.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Convert an EML abstract to markdown
f <- system.file("examples/hf205.xml", package = "EML")
eml <- read_eml(f)
abstract <- eml_get(eml, "abstract")
get_TextType(abstract[[1]], "markdown", "abstract.markdown")
readLines("abstract.markdown")
unlink("abstract.markdown") # tidy up

## Turn a docx file into EML abstract and preview at HTML
f <- system.file("examples/hf205-abstract.docx", package = "EML")
a <- as(set_TextType(f), "abstract")
get_TextType(a)

clnsmth/EML103 documentation built on May 22, 2019, 5:32 p.m.