Skip to content

A semantic parser for ProseMirror/TipTap content structures that helps bridge the gap between natural content writing and component-based web development.

License

Notifications You must be signed in to change notification settings

uniwebcms/semantic-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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");

// Your ProseMirror/TipTap document
const doc = {
  type: "doc",
  content: [
    {
      type: "heading",
      attrs: { level: 1 },
      content: [{ type: "text", text: "Title" }],
    },
    // ...more content
  ],
};

// Parse the content
const parsed = parseContent(doc);

// Access different views of the content
console.log(parsed.sequence); // Flat sequence of elements
console.log(parsed.groups); // Content organized into semantic groups
console.log(parsed.byType); // Content organized by element type

Documentation

See Content Writing Guide for detailed information about content structuring conventions.

License

Apache License 2.0

About

A semantic parser for ProseMirror/TipTap content structures that helps bridge the gap between natural content writing and component-based web development.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •