kroki 0.0.4 copy "kroki: ^0.0.4" to clipboard
kroki: ^0.0.4 copied to clipboard

Class for accessing Kroki.io web service for diagram syntax to svg rendering.

example/kroki_example.dart

import 'dart:io';
import 'package:kroki/kroki.dart';

void main() async {
  final Kroki kroki = Kroki();

  // Send every sample to kroki and print SVGs
  int count = 0;
  for (final sample in KrokiSampleDiagrams.samples) {
    print('Convert example $count endpoint ${sample.diagramType}:');
    final svg =
        await kroki.convertDiagram(sample.diagramType, sample.diagramSource);
    print('''
SVG = 
$svg
''');
    print('---------------------------------------------------------');
    count++;
  }

  print('----------------------------------------------');
  print('----------------------------------------------');
  print('----------------------------------------------');

  //  Create a markdown file with all the sample diagrams
  List<String> markdownLines = [];

  for (final sample in KrokiSampleDiagrams.samples) {
    markdownLines.add('''
## [${sample.name}](${sample.url})
----------------------------------
```${sample.diagramType}
${sample.diagramSource}
```
''');
  }

  print(markdownLines.join('\n'));

  exit(0);
}
7
likes
140
points
58
downloads

Publisher

verified publisherhiveright.tech

Weekly Downloads

Class for accessing Kroki.io web service for diagram syntax to svg rendering.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

archive, crypto, http

More

Packages that depend on kroki