notustohtml 0.0.9-dev.3.0 copy "notustohtml: ^0.0.9-dev.3.0" to clipboard
notustohtml: ^0.0.9-dev.3.0 copied to clipboard

outdated

Convert the Notus document format to an HTML representation.

example/main.dart

import 'package:notus/notus.dart';
import 'package:notustohtml/notustohtml.dart';
import 'package:quill_delta/quill_delta.dart';

void main() {
  final converter = NotusHtmlCodec();

  // Replace with the document you have take from the Zefyr editor
  final doc = NotusDocument.fromJson(
    [
      {
        "insert": "Hello World!",
      },
      {
        "insert": "\n",
        "attributes": {
          "heading": 1,
        },
      },
    ],
  );

  String html = converter.encode(doc.toDelta());
  print(html); // The HTML representation of the Notus document

  Delta delta = converter.decode(html); // Zefyr compatible Delta
  NotusDocument document = NotusDocument.fromDelta(delta); // Notus document ready to be loaded into Zefyr
}
18
likes
0
pub points
73%
popularity

Publisher

verified publisherwrenn.me

Convert the Notus document format to an HTML representation.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

html, notus, quill_delta

More

Packages that depend on notustohtml