| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
JSON-DOC is a standardized format for storing structured content in JSON files, inspired by Notion's data model. It supports a wide variety of content types including paragraphs, headings, lists, tables, images, code blocks, and more.
This project provides:
pip install python-jsondocnpm install @textcortex/jsondocfrom jsondoc import load_json_doc, json_doc_dump_json
from jsondoc.convert.html import convert_html_to_json_doc
# Load a JSON-DOC document
with open('document.json', 'r') as f:
doc = load_json_doc(f.read())
# Convert HTML to JSON-DOC
html_content = "<h1>Hello World</h1><p>This is a paragraph.</p>"
json_doc = convert_html_to_json_doc(html_content)
# Serialize back to JSON
json_str = json_doc_dump_json(json_doc)import { loadJsonDoc, JsonDocRenderer } from '@textcortex/jsondoc';
import React from 'react';
// Load and render a JSON-DOC document
const App = () => {
const doc = loadJsonDoc(jsonDocData);
return (
<div>
<JsonDocRenderer document={doc} />
</div>
);
};. ├── schema/ # JSON Schema definitions ├── python/ # Python implementation ├── typescript/ # TypeScript implementation ├── docs/ # Documentation ├── examples/ # Example files and usage └── .github/workflows/ # CI/CD pipelines
# Setup
cd python
pip install -e ".[dev]"
# Run tests
pytest
# Format code
ruff format .
ruff check .
# Validate schemas
python tests/test_validation.py schema# Setup
cd typescript
npm install
# Generate types from schemas
npm run generate-types
# Build
npm run build
# Run tests
npm test
# Format code (runs automatically on commit)
npm run formatThe format is defined using JSON Schema with these core components:
See the examples/ directory for:
MIT License - see LICENSE for details.
Inspired by Notion's block-based document model. This project aims to provide an open, standardized format for structured content representation.
| Back | FazBrowse Home | New Git URL |