@uniwebcms/semantic-parser
A semantic parser for ProseMirror/TipTap content structures that helps bridge the gap between natural content writing and component-based web development.
Installation
npm install @uniwebcms/semantic-parser
Usage
const { parseContent } = require("@uniwebcms/semantic-parser");
const doc = {
type: "doc",
content: [
{
type: "heading",
attrs: { level: 1 },
content: [{ type: "text", text: "Title" }],
},
],
};
const parsed = parseContent(doc);
console.log(parsed.sequence);
console.log(parsed.groups);
console.log(parsed.byType);
Documentation
See Content Writing Guide for detailed information about content structuring conventions.
License
Apache License 2.0