{"id":28972460,"url":"https://github.com/textcortex/json-doc","last_synced_at":"2025-06-24T11:06:41.851Z","repository":{"id":281892175,"uuid":"840049395","full_name":"textcortex/JSON-DOC","owner":"textcortex","description":"JSON-DOC is a block based document file format and data model based on Notion (work in progress)","archived":false,"fork":false,"pushed_at":"2025-06-23T22:44:44.000Z","size":1143,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-24T11:02:40.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/textcortex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-08T21:40:30.000Z","updated_at":"2025-06-23T22:44:47.000Z","dependencies_parsed_at":"2025-05-19T12:29:03.582Z","dependency_job_id":"5da41165-46ba-4749-b62a-a11224afaa0d","html_url":"https://github.com/textcortex/JSON-DOC","commit_stats":null,"previous_names":["textcortex/json-doc"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/textcortex/JSON-DOC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textcortex%2FJSON-DOC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textcortex%2FJSON-DOC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textcortex%2FJSON-DOC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textcortex%2FJSON-DOC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/textcortex","download_url":"https://codeload.github.com/textcortex/JSON-DOC/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textcortex%2FJSON-DOC/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261658586,"owners_count":23191088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-24T11:02:28.565Z","updated_at":"2025-06-24T11:06:41.843Z","avatar_url":"https://github.com/textcortex.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON-DOC\n\nJSON-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.\n\n## Overview\n\nThis project provides:\n\n1. **JSON Schema Specification**: Complete schema definitions for all JSON-DOC structures\n2. **Python Implementation**: Full-featured Python library with validation and conversion tools\n3. **TypeScript Implementation**: TypeScript library with React renderer components\n4. **Format Converters**: Tools to convert between JSON-DOC and other formats (HTML, Markdown, etc.)\n\n## Installation\n\n### Python Package\n\n```bash\npip install python-jsondoc\n```\n\n### TypeScript Package\n\n```bash\nnpm install @textcortex/jsondoc\n```\n\n## Quick Start\n\n### Python\n\n```python\nfrom jsondoc import load_json_doc, json_doc_dump_json\nfrom jsondoc.convert.html import convert_html_to_json_doc\n\n# Load a JSON-DOC document\nwith open('document.json', 'r') as f:\n    doc = load_json_doc(f.read())\n\n# Convert HTML to JSON-DOC\nhtml_content = \"\u003ch1\u003eHello World\u003c/h1\u003e\u003cp\u003eThis is a paragraph.\u003c/p\u003e\"\njson_doc = convert_html_to_json_doc(html_content)\n\n# Serialize back to JSON\njson_str = json_doc_dump_json(json_doc)\n```\n\n### TypeScript\n\n```typescript\nimport { loadJsonDoc, JsonDocRenderer } from '@textcortex/jsondoc';\nimport React from 'react';\n\n// Load and render a JSON-DOC document\nconst App = () =\u003e {\n  const doc = loadJsonDoc(jsonDocData);\n\n  return (\n    \u003cdiv\u003e\n      \u003cJsonDocRenderer document={doc} /\u003e\n    \u003c/div\u003e\n  );\n};\n```\n\n## Features\n\n### Core Features\n- **Structured Content**: Documents represented as hierarchical blocks\n- **Rich Text Support**: Text formatting with bold, italic, links, equations, and more\n- **Nested Blocks**: Support for complex document structures with nested content\n- **Schema Validation**: Full JSON Schema validation for all content types\n\n### Supported Block Types\n- **Text Blocks**: Paragraphs, headings (1-3), quotes, code blocks\n- **List Blocks**: Bulleted lists, numbered lists, to-do lists, toggles\n- **Media Blocks**: Images (external URLs and file references), equations\n- **Layout Blocks**: Columns, dividers, tables\n- **Interactive Blocks**: To-do items with checkbox state\n- Check schema/ for all block types\n\n### Format Conversion\n- Convert between JSON-DOC and all other formats with HTML as the intermediate format\n\n## Repository Structure\n\n```\n.\n├── schema/                 # JSON Schema definitions\n├── python/                # Python implementation\n├── typescript/            # TypeScript implementation\n├── docs/                  # Documentation\n├── examples/              # Example files and usage\n└── .github/workflows/     # CI/CD pipelines\n```\n\n## Development\n\n### Python Development\n\n```bash\n# Setup\ncd python\npip install -e \".[dev]\"\n\n# Run tests\npytest\n\n# Format code\nruff format .\nruff check .\n\n# Validate schemas\npython tests/test_validation.py schema\n```\n\n### TypeScript Development\n\n```bash\n# Setup\ncd typescript\nnpm install\n\n# Generate types from schemas\nnpm run generate-types\n\n# Build\nnpm run build\n\n# Run tests\nnpm test\n\n# Format code (runs automatically on commit)\nnpm run format\n```\n\n## Architecture\n\n### JSON-DOC Schema\n\nThe format is defined using JSON Schema with these core components:\n\n- **Page**: Top-level container with metadata and children blocks\n- **Block**: Content blocks of various types (paragraph, heading, list, etc.)\n- **Rich Text**: Formatted text content with styling and annotations\n- **File**: External file references for images and attachments\n\n### Implementation Philosophy\n- **Schema-First**: All types generated programmatically from JSON schemas\n- **Validation**: Comprehensive validation using JSON Schema\n- **Serialization**: Perfect round-trip serialization between JSON and typed objects\n- **Extensibility**: Easy to add new block types via schema updates\n\n## Examples\n\nSee the [`examples/`](./examples/) directory for:\n- Sample JSON-DOC documents\n- HTML conversion examples\n- Usage patterns and best practices\n\n## Documentation\n\n- [JSON-DOC Specification](./docs/json-doc-spec.md)\n- [Python Implementation Guide](./docs/python-implementation.md)\n- [TypeScript Implementation Guide](./docs/typescript-implementation.md)\n- [Conversion Guide](./docs/conversion.md)\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes with tests\n4. Run the full test suite\n5. Submit a pull request\n\n## License\n\nMIT License - see [LICENSE](./LICENSE) for details.\n\n## Acknowledgments\n\nInspired by [Notion's](https://notion.so) block-based document model. This project aims to provide an open, standardized format for structured content representation.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextcortex%2Fjson-doc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftextcortex%2Fjson-doc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextcortex%2Fjson-doc/lists"}