Kroki class
The Kroki class provides the convertDiagram method which will
package up the diagram source contained within the diagramSource
parameter and send it to the Kroki webservice endpoint corresponding
to the diagramType
parameter.
It returns a future which will become the SVG for the converted diagram
once the future is completed.
If the specified diagramType
is not supported or if an error occurs at
the endpoint then a text error message will be returned.
Constructors
Properties
-
cache
↔ Map<
String, String> -
Rudimentary cache to prevent hammering kroki.io with same requests,
replace with Redis for real world use.
getter/setter pair
- cacheRequests ↔ bool
-
Defaults to false, will cache all diagram request results so that we don't
ask endpoint to keep converting an unchanged file. SIMPLE caching, need
to use redis for real world use. This is used for live editing markdown
example, etc. - where we repeatedly convert the all diagrams regardless when
markdown changes.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- krokiApiUrl ↔ String
-
Base URI for the kroki endpoint that will be used to convert the
diagram source. Defaults to the public Kroki web service, however
this parameter allows the use of alternate, or in house installations
of the Kroki web service.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
convertDiagram(
String diagramType, String diagramSource) → Future< String> -
generateMd5(
String input) → String -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited