moonrockz/diagrams-plantuml
Types
Conversion
pub struct Conversion {
diagram : @moonrockz/diagrams/render.Diagram?
diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
}Document
pub(all) enum Document {
Regex(@moonrockz/diagrams-plantuml/regex.Document)
Ebnf(@moonrockz/diagrams-plantuml/ebnf.Document)
Json(@moonrockz/diagrams-plantuml/json.Document)
Yaml(@moonrockz/diagrams-plantuml/yaml.Document)
Activity(@moonrockz/diagrams-plantuml/activity.Document)
State(@moonrockz/diagrams-plantuml/state.Document)
} derive(Eq, @moonbitlang/core/debug.Debug)One parsed native block of a supported kind.
Document::equal
fn Document::equal(Document, Document) -> BoolDocument::kind
fn Document::kind(self : Document) -> @moonrockz/diagrams-plantuml/envelope.KindDocument::not_equal
fn Document::not_equal(x : Document, y : Document) -> BoolDocument::to_repr
fn Document::to_repr(Document) -> @moonbitlang/core/debug.ReprPrintResult
pub struct PrintResult {
output : String?
diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
} derive(Eq, @moonbitlang/core/debug.Debug)PrintResult::equal
fn PrintResult::equal(PrintResult, PrintResult) -> BoolPrintResult::not_equal
fn PrintResult::not_equal(x : PrintResult, y : PrintResult) -> BoolPrintResult::to_repr
fn PrintResult::to_repr(PrintResult) -> @moonbitlang/core/debug.ReprReadResult
pub struct ReadResult {
tree : @moonrockz/diagrams-plantuml/cst.Node
document : Document?
diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
}The result of reading. tree reproduces every input code unit. Activity
recovery can retain a partial document; diagnostics determine validity.
The other native readers return no document after an error.
Values
diagnostic_codes
let diagnostic_codes : ReadOnlyArray[String]The stable diagnostic codes of the PlantUML module.
plantuml_commit
let plantuml_commit : StringThe source commit of the pinned PlantUML version.
plantuml_version
let plantuml_version : StringThe pinned PlantUML version whose native behavior this library follows.
print
fn print(document : Document, limits? : @moonrockz/diagrams-plantuml/envelope.Limits) -> PrintResultWrite a complete native block: start marker, retained statements, the body and the end marker. The output limit applies to the whole text.
print_body
fn print_body(document : Document, limits? : @moonrockz/diagrams-plantuml/envelope.Limits) -> PrintResultWrite only the body of a document, from its typed values.
read
fn read(source : String, limits? : @moonrockz/diagrams-plantuml/envelope.Limits) -> ReadResultRead one regex, EBNF, JSON, YAML, state or modern/legacy activity block with its
matching end marker. State and activities use @startuml and @enduml. Other UML
kinds, extra blocks and text outside the block are errors.
read_body
fn read_body(kind : @moonrockz/diagrams-plantuml/envelope.Kind, body : String, dialect? : @moonrockz/diagrams-plantuml/activity.Dialect, limits? : @moonrockz/diagrams-plantuml/envelope.Limits) -> ReadResultRead a raw body of an explicit kind, without block markers.
render_svg
fn render_svg(source : String, renderer? : @moonrockz/diagrams-svg.SvgRenderer, limits? : @moonrockz/diagrams-plantuml/envelope.Limits, id? : String) -> @moonrockz/diagrams/render.RenderedRead, convert and render one native block as standalone SVG with the
options of renderer, including any supplied trace highlights.
Diagnostics accumulate; any error gives no output.
render_traced_svg
fn[P : @moonrockz/diagrams/railroad-trace.RailroadTraceProvider] render_traced_svg(source : String, provider : P, input : String, start_rule? : String, renderer? : @moonrockz/diagrams-svg.SvgRenderer, limits? : @moonrockz/diagrams-plantuml/envelope.Limits, trace_limits? : @moonrockz/diagrams/railroad-trace.TraceLimits, matched? : @moonrockz/diagrams-svg.ChannelStyle, not_matched? : @moonrockz/diagrams-svg.ChannelStyle, taken? : @moonrockz/diagrams-svg.ChannelStyle, failure? : @moonrockz/diagrams-svg.ChannelStyle) -> @moonrockz/diagrams-svg.TracedRenderRead and convert one regex or EBNF block, invoke provider once for
input and render the validated trace. start_rule names an EBNF start
rule by its rule name. This is the only PlantUML entry point that calls a
provider.
to_diagram
fn to_diagram(document : Document, id? : String, limits? : @moonrockz/diagrams-plantuml/envelope.Limits) -> ConversionConvert a document to its format-independent model.