docsy_html 0.1.2
docsy_html: ^0.1.2 copied to clipboard
HTML import and export support for Docsy, the modular Flutter WYSIWYG editor. Convert documents seamlessly between Docsy and HTML.
Docsy HTML #
The Docsy HTML package provides import and export functionality for the Docsy editor.
It allows you to serialize Docsy documents into HTML and restore them back into Docsy.
✨ Features #
- Export any Docsy
Documentinto valid HTML5. - Supports paragraphs, headings, quotes, dividers, code blocks, inline marks (bold, italic, underline, code, links).
- Lightweight output using the
htmlpackage for parsing on import.
🚀 Installation #
Add this to your pubspec.yaml:
dependencies:
docsy_html: ^0.1.1
📖 Usage #
import 'package:docsy/docsy.dart';
import 'package:docsy_html/docsy_html.dart';
void main() {
final doc = Document([
ParagraphNode(inlines: [
TextSpanNode("Hello ", marks: TextMarks()),
TextSpanNode("world", marks: TextMarks(bold: true)),
]),
]);
final html = DocsyHtmlCodec().encode(doc);
print(html); // <p>Hello <strong>world</strong></p>
}
📷 Example #
<p>Hello <strong>world</strong></p>
📜 License #
MIT License. See LICENSE.