feat(spaces): implement Phase 0-1 of Information Space Service
Phase 0 - Project Organization: - Create docs/PROJECT_STRUCTURE.md documenting codebase layout - Create markitect/core/ with parser, serializer, document_manager, workspace - Create markitect/schema/ consolidating 6 schema_*.py modules - Create markitect/storage/ with database module - Maintain backward compatibility via re-exports from original locations - Add docs/roadmap/information-space-service/ with README and WORKPLAN Phase 1 - Foundation (Weeks 1-3): - Week 1: Core domain models (InformationSpace, SpaceDocument, SpaceConfig, SpaceMetadata, SpaceVariable, TransclusionReference, SpaceStatus) - Week 2: Repository layer with interfaces (ISpaceRepository, IDocumentAssociationRepository, IVariableRepository, IReferenceRepository) and SQLite implementations with foreign key cascade deletes - Week 3: SpaceService orchestration layer with full CRUD, document, variable, and reference tracking operations Test coverage: 124 tests (25 model + 63 repository + 36 integration) Capabilities delivered: - CAP-001: InformationSpace entity with lifecycle management - CAP-002: SpaceRepository CRUD with SQLite backing - CAP-003: Document-Space associations with path-based organization - CAP-004: Space metadata and configuration schemas - CAP-005: Database schema with migrations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,26 +1,11 @@
|
||||
from markdown_it import MarkdownIt
|
||||
"""
|
||||
Markdown AST Parser - Backward Compatibility Module.
|
||||
|
||||
def parse_markdown_to_ast(md_content: str):
|
||||
# Enable table parsing and other common plugins
|
||||
md = MarkdownIt("commonmark", {"tables": True}).enable(['table'])
|
||||
tokens = md.parse(md_content)
|
||||
# Convert to a JSON-serializable list of dicts (tokens are objects, so we dict-ify them recursively)
|
||||
def token_to_dict(token):
|
||||
d = {
|
||||
'type': token.type,
|
||||
'tag': token.tag,
|
||||
'attrs': token.attrs,
|
||||
'map': token.map,
|
||||
'nesting': token.nesting,
|
||||
'level': token.level,
|
||||
'children': [token_to_dict(child) if child else None for child in token.children] if token.children else None,
|
||||
'content': token.content,
|
||||
'markup': token.markup,
|
||||
'info': token.info,
|
||||
'meta': token.meta,
|
||||
'block': token.block,
|
||||
'hidden': token.hidden
|
||||
}
|
||||
return {k: v for k, v in d.items() if v is not None} # Remove None values for cleanliness
|
||||
This module re-exports from markitect.core.parser for backward compatibility.
|
||||
New code should import from markitect.core.parser directly.
|
||||
"""
|
||||
|
||||
return [token_to_dict(token) for token in tokens]
|
||||
# Re-export from core for backward compatibility
|
||||
from markitect.core.parser import parse_markdown_to_ast
|
||||
|
||||
__all__ = ['parse_markdown_to_ast']
|
||||
|
||||
Reference in New Issue
Block a user