notustohtml 1.0.0-rc.2 copy "notustohtml: ^1.0.0-rc.2" to clipboard
notustohtml: ^1.0.0-rc.2 copied to clipboard

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
140
points
84
downloads

Publisher

verified publisherwrenn.me

Weekly Downloads

Convert the Notus document format to an HTML representation.

Repository (GitHub)

Documentation

API reference

License

unknown (license)

Dependencies

html, notus, quill_delta

More

Packages that depend on notustohtml