feat: implement clean TDD-driven editor with enhanced status dialog
- Replace legacy editor with clean object-oriented architecture - Add comprehensive test-driven Section, SectionManager, and DOMRenderer classes - Implement four-layer content management with proper action semantics - Add multiple concurrent section editing capability - Implement intelligent section splitting with heading detection - Add enhanced status dialog with repository info, version, and save filename - Include git commit information and modification status - Provide actual save filename preview instead of source filename - Maintain proper section positioning and global reset functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1430
markitect/clean_document_manager.py
Normal file
1430
markitect/clean_document_manager.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -101,7 +101,7 @@ def detect_execution_mode():
|
|||||||
def should_use_associated_files():
|
def should_use_associated_files():
|
||||||
"""Determine if commands should use associated files behavior."""
|
"""Determine if commands should use associated files behavior."""
|
||||||
return detect_execution_mode() == 'interactive'
|
return detect_execution_mode() == 'interactive'
|
||||||
from .document_manager import DocumentManager
|
# DocumentManager removed - using CleanDocumentManager directly in commands
|
||||||
from .serializer import ASTSerializer
|
from .serializer import ASTSerializer
|
||||||
from .cache_service import CacheDirectoryService
|
from .cache_service import CacheDirectoryService
|
||||||
from .ast_service import ASTService
|
from .ast_service import ASTService
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ from typing import Dict, Any
|
|||||||
|
|
||||||
from markitect.plugins.base import CommandPlugin, PluginMetadata, PluginType
|
from markitect.plugins.base import CommandPlugin, PluginMetadata, PluginType
|
||||||
from markitect.plugins.decorators import register_plugin
|
from markitect.plugins.decorators import register_plugin
|
||||||
from markitect.document_manager import DocumentManager
|
# DocumentManager removed - using CleanDocumentManager directly
|
||||||
from markitect.serializer import ASTSerializer
|
from markitect.serializer import ASTSerializer
|
||||||
|
|
||||||
|
|
||||||
@@ -1659,7 +1659,7 @@ def md_list_command(ctx, output_format, names_only):
|
|||||||
@click.option('--css', type=click.Path(),
|
@click.option('--css', type=click.Path(),
|
||||||
help='Custom CSS file to include')
|
help='Custom CSS file to include')
|
||||||
@click.option('--edit', is_flag=True,
|
@click.option('--edit', is_flag=True,
|
||||||
help='Open in live edit mode with preview')
|
help='Open in interactive edit mode with stable section editing')
|
||||||
@click.option('--editor-theme', default='github',
|
@click.option('--editor-theme', default='github',
|
||||||
type=click.Choice(['github', 'monokai', 'tomorrow', 'dark']),
|
type=click.Choice(['github', 'monokai', 'tomorrow', 'dark']),
|
||||||
help='Editor theme for live edit mode (default: github)')
|
help='Editor theme for live edit mode (default: github)')
|
||||||
@@ -1704,17 +1704,20 @@ def md_render_command(ctx, input_file, output, template, css, edit, editor_theme
|
|||||||
ensure_publication_directory(pub_dir)
|
ensure_publication_directory(pub_dir)
|
||||||
output_path = pub_dir / get_output_filename(input_path)
|
output_path = pub_dir / get_output_filename(input_path)
|
||||||
|
|
||||||
# Initialize document manager
|
# Initialize clean document manager
|
||||||
doc_manager = DocumentManager(config.get('db_manager'))
|
from markitect.clean_document_manager import CleanDocumentManager
|
||||||
|
doc_manager = CleanDocumentManager(config.get('db_manager'))
|
||||||
|
|
||||||
# Render the file
|
# Render the file
|
||||||
if edit:
|
if edit:
|
||||||
# Live edit mode - generate HTML with editing capabilities
|
# Edit mode - generate HTML with editing capabilities
|
||||||
result = doc_manager.render_file(input_file, str(output_path),
|
result = doc_manager.render_file(input_file, str(output_path),
|
||||||
template=template, css=css,
|
template=template, css=css,
|
||||||
edit_mode=True, editor_theme=editor_theme,
|
edit_mode=True,
|
||||||
|
editor_theme=editor_theme,
|
||||||
keyboard_shortcuts=keyboard_shortcuts)
|
keyboard_shortcuts=keyboard_shortcuts)
|
||||||
click.echo(f"✓ Rendered with editing capabilities to: {output_path}")
|
|
||||||
|
click.echo(f"✓ Rendered with interactive editing capabilities to: {output_path}")
|
||||||
|
|
||||||
if config.get('verbose', False):
|
if config.get('verbose', False):
|
||||||
click.echo(f"Editor theme: {editor_theme}")
|
click.echo(f"Editor theme: {editor_theme}")
|
||||||
|
|||||||
Reference in New Issue
Block a user