moonrockz/diagrams-plantuml

Types

Conversion

pub struct Conversion {
  diagram : @moonrockz/diagrams/render.Diagram?
  diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
}

Source

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.

Source

Document::equal

fn Document::equal(Document, Document) -> Bool

Source

Document::kind

fn Document::kind(self : Document) -> @moonrockz/diagrams-plantuml/envelope.Kind

Source

Document::not_equal

fn Document::not_equal(x : Document, y : Document) -> Bool

Source

Document::to_repr

fn Document::to_repr(Document) -> @moonbitlang/core/debug.Repr

Source

PrintResult

pub struct PrintResult {
  output : String?
  diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
} derive(Eq, @moonbitlang/core/debug.Debug)

Source

PrintResult::equal

fn PrintResult::equal(PrintResult, PrintResult) -> Bool

Source

PrintResult::not_equal

fn PrintResult::not_equal(x : PrintResult, y : PrintResult) -> Bool

Source

PrintResult::to_repr

fn PrintResult::to_repr(PrintResult) -> @moonbitlang/core/debug.Repr

Source

ReadResult

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.

Source

Values

diagnostic_codes

let diagnostic_codes : ReadOnlyArray[String]

The stable diagnostic codes of the PlantUML module.

Source

plantuml_commit

let plantuml_commit : String

The source commit of the pinned PlantUML version.

Source

plantuml_version

let plantuml_version : String

The pinned PlantUML version whose native behavior this library follows.

Source

print

fn print(document : Document, limits? : @moonrockz/diagrams-plantuml/envelope.Limits) -> PrintResult

Write a complete native block: start marker, retained statements, the body and the end marker. The output limit applies to the whole text.

Source

fn print_body(document : Document, limits? : @moonrockz/diagrams-plantuml/envelope.Limits) -> PrintResult

Write only the body of a document, from its typed values.

Source

read

fn read(source : String, limits? : @moonrockz/diagrams-plantuml/envelope.Limits) -> ReadResult

Read 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.

Source

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) -> ReadResult

Read a raw body of an explicit kind, without block markers.

Source

render_svg

fn render_svg(source : String, renderer? : @moonrockz/diagrams-svg.SvgRenderer, limits? : @moonrockz/diagrams-plantuml/envelope.Limits, id? : String) -> @moonrockz/diagrams/render.Rendered

Read, 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.

Source

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.TracedRender

Read 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.

Source

to_diagram

fn to_diagram(document : Document, id? : String, limits? : @moonrockz/diagrams-plantuml/envelope.Limits) -> Conversion

Convert a document to its format-independent model.

Source