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

outdated

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
0
points
62
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

License

unknown (license)

Dependencies

archive, crypto, http

More

Packages that depend on kroki