Skip to content

renderPreproc

Renders PlantUML source to PREPROC (preprocessed) text — the output of the TIM engine after applying !include, !define, variables, and conditionals.

pub fn render_preproc(source: &str) -> Result<String, RenderError>
use plantuml_engine::render_preproc;
let text = render_preproc("@startuml\n!define FOO bar\nAlice -> Bob: FOO\n@enduml")?;
println!("{text}");

Returns RenderError::Utf8 if the rendered output is not valid UTF-8.

import { renderPreproc } from '@vgerbot/plantuml';
const text = await renderPreproc('@startuml\n!define FOO bar\nAlice -> Bob: FOO\n@enduml');