DOCUMENTATION

📍 ProseMirror Content Schema Documentation

This document provides a complete reference of the ProseMirror schema and a sample document representation, intended for software development and content validation.

🔢 Schema Node Types

✍️ Paragraph (type: "paragraph")

content: Array<text>
Used to render basic blocks of text.

📜 Text Node (type: "text")

text: string
marks: Array<mark>

✨ Marks

Each mark in marks array:
{
type: "bold" | "italic" | "underline" | "strike" | "link" | "textStyle" | "highlight",
attrs?: {
href?: string,
target?: string,
rel?: string,
class?: string,
color?: string, // hex format or rgba format
}
}

📄 Heading (type: "heading")

attrs:
{
level: 1 | 2 | 3
}

content: Same as paragraph

💬 Callout (type: "callout")

attrs:
{
type: "info" | "warning",
icon: "megaphone"
}

content: Array<paragraph>

• Bullet List (type: "bulletList")

content: Array<listItem>
listItem contains a paragraph
Lists can be nested

➀ Ordered List (type: "orderedList")

attrs:
{
start: number,
type: null
}

content: Array<listItem>

❛ Block Quote (type: "blockquote")

content: Array<paragraph>

💻 Code Block (type: "monacoCodeBlock")

attrs:
{
language: string // e.g., "javascript"
}

🎥 YouTube Embed (type: "youtube")

attrs:
{
src: string,
start: number,
width: number,
height: number
}

🖼️ Image (type: "image")

attrs:
{
src: string,
alt: string,
title: null,
width: number | null,
height: number | null
}

⚠️ Note: Resizing currently removes alt text.

🎵 Audio / 🎥 Video / 📄 File (type: "audio" | "video" | "file")

attrs:
{
src: string,
title: string
}

📈 Table

Inconsistent schema — currently under revision.

❓ MCQ Question (type: "mcq-question")

attrs:
{
question: string | null,
options: Array<{
id: number,
text: string,
correct: boolean
}>,
saveToLibrary: boolean,
aiValidation: boolean,
assignMarks: boolean,
marks: number,
answerRequired: boolean,
aiAgeGroup: string,
aiSubjectContext: string,
aiValidationPrompt: string
}

📁 File Upload Question (type: "file-upload-question")

attrs:
{
question: string,
allowedFileTypes: string[],
uploadLabel: string,
saveToLibrary: boolean,
aiValidation: boolean,
assignMarks: boolean,
marks: number,
answerRequired: boolean,
aiAgeGroup: string,
aiSubjectContext: string,
aiValidationPrompt: string
}

🔧 Custom Question (type: "custom-question")

attrs:
{
question: string,
answerRequired: boolean,
saveToLibrary: boolean,
answers: Array<{
id: string,
type: "text" | "image" | "video" | "pdf",
config: object // See below
}>
}

Custom Answer Configs

MCQ:
{
options: Array<{
id: string,
text: string,
correct: boolean
}>
}

Media (image/video/audio/file):
{
uploadLabel: string
}

Text:
{
placeholder: string
}

📚 Sample Content Example (Summarized)

Paragraph with bold/italic/underline
Paragraph with styled link
Callout (info + warning)
Bullet and ordered list (nested supported)
Headings (level 1-3)
Block quote with paragraphs
This schema ensures rich content modeling for educational, content-authoring, or CMS-based systems using ProseMirror.
info
Keep track of each meeting topic in a new row, and add details in the notes column. Row order is based on the date, which can be changed in the table’s sort option.
Clear sample data
Agenda
Search
Done
Topic
Notes
Date
Added by
Create a workback plan for next year’s event
Tue, Jan 25
Share & discuss customer stories
Tue, Feb 22
Vote on top customer stories to amplify
Tue, Mar 1
There are no rows in this table
export const deleteContentNode = async (
req: TypedRequest['deleteContent'],
res: TypedResponse<Responses['deleteContent']>,
) => {
try {
const nodeId = req.params.nodeId;
const customerId = req.body.customerId;
const response = await service.deleteContentNode(nodeId, customerId);
res.status(200).json(response);
} catch (error) {
if (error instanceof HttpError) {
res.status(error.statusCode).json({
statusCode: error.statusCode,
error: error.error,
message: error.message,
});
} else {
throw error;
}
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.