This function provides a knit engine for the plantuml. It has the following additional functions:

  • plantuml.format: the format of the generated image. For formats which return images, these will be inserted, formats resulting in text qill be included as text. At the moment, the following are supported:

    • auto (default) uses svg if output is html and pdf if output is pdf

    • png To generate image using PNG format (default).

    • svg To generate image using SVG format.

    • eps To generate text in EPS format; or generates an image when outputting LaTeX rather than HTML formats.

  • plantuml.path: the path where the resulting files will be saved. Default is the same directory as the .Rmd file is in. The path will be created if it does not exist.

  • plantuml.preview: if TRUE, an inline preview will be shown in RStudio. Attention: the processing takse twice as long as without this option!.

plantuml_knit_engine(options)

Arguments

options

knitr options see knitr

Value

See knit_engines in the knitr packages for details

Details

Thanks to Emiliano Heyns (retorquere) for giving me the idea for this functiion https://github.com/rkrug/plantuml/issues/10#issue-639795529 See knit_engines in the knitr packages for details

Examples

if (FALSE) {
## see
system.file("plantuml.Rmd", package = "plantuml")
## for an example RMarkdown file usint this knit engine.
}