notustohtml 0.0.8 icon indicating copy to clipboard operation
notustohtml: ^0.0.8 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
90
pub points
80%
popularity

Publisher

verified publisher iconwrenn.me

Convert the Notus document format to an HTML representation.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.unknown (LICENSE)

Dependencies

html, notus, quill_delta

More

Packages that depend on notustohtml