108 lines
2.6 KiB
Python
108 lines
2.6 KiB
Python
|
|
"""
|
||
|
|
Enums for explode-implode variant system.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from enum import Enum
|
||
|
|
|
||
|
|
|
||
|
|
class ExplodeVariant(Enum):
|
||
|
|
"""
|
||
|
|
Available explode variants for different directory organization strategies.
|
||
|
|
|
||
|
|
Each variant defines how a markdown file is exploded into a directory
|
||
|
|
structure and how that structure is imploded back.
|
||
|
|
"""
|
||
|
|
|
||
|
|
FLAT = "flat"
|
||
|
|
"""
|
||
|
|
Flat structure - current default behavior.
|
||
|
|
Creates directories based on h1 headings with nested content.
|
||
|
|
|
||
|
|
Example:
|
||
|
|
book.mdd/
|
||
|
|
├── manifest.md
|
||
|
|
├── book_title/
|
||
|
|
│ ├── index.md
|
||
|
|
│ ├── chapter_1.md
|
||
|
|
│ └── chapter_2.md
|
||
|
|
└── conclusion.md
|
||
|
|
"""
|
||
|
|
|
||
|
|
HIERARCHICAL = "hierarchical"
|
||
|
|
"""
|
||
|
|
Hierarchical structure with numbered prefixes.
|
||
|
|
Creates nested directories reflecting heading hierarchy with ordering.
|
||
|
|
|
||
|
|
Example:
|
||
|
|
book.mdd/
|
||
|
|
├── manifest.md
|
||
|
|
├── 01_book_title/
|
||
|
|
│ ├── index.md
|
||
|
|
│ ├── 01_chapter_1/
|
||
|
|
│ │ ├── index.md
|
||
|
|
│ │ └── 01_section_1.md
|
||
|
|
│ └── 02_chapter_2/
|
||
|
|
└── 99_conclusion.md
|
||
|
|
"""
|
||
|
|
|
||
|
|
SEMANTIC = "semantic"
|
||
|
|
"""
|
||
|
|
Semantic structure with content-based grouping.
|
||
|
|
Groups content into semantic categories like parts, chapters, appendices.
|
||
|
|
|
||
|
|
Example:
|
||
|
|
book.mdd/
|
||
|
|
├── manifest.md
|
||
|
|
├── parts/
|
||
|
|
│ ├── 01_fundamentals/
|
||
|
|
│ └── 02_advanced/
|
||
|
|
├── chapters/
|
||
|
|
│ ├── 01_basics/
|
||
|
|
│ └── 02_intermediate/
|
||
|
|
└── appendices/
|
||
|
|
"""
|
||
|
|
|
||
|
|
|
||
|
|
class ExplodeMode(Enum):
|
||
|
|
"""
|
||
|
|
Modes for explode operations affecting behavior and output.
|
||
|
|
"""
|
||
|
|
|
||
|
|
STANDARD = "standard"
|
||
|
|
"""Standard explode operation with manifest generation."""
|
||
|
|
|
||
|
|
LEGACY = "legacy"
|
||
|
|
"""Legacy mode without manifest for backward compatibility."""
|
||
|
|
|
||
|
|
PREVIEW = "preview"
|
||
|
|
"""Preview mode showing what would be created without actual creation."""
|
||
|
|
|
||
|
|
|
||
|
|
class ManifestVersion(Enum):
|
||
|
|
"""
|
||
|
|
Manifest format versions for backward compatibility.
|
||
|
|
"""
|
||
|
|
|
||
|
|
V1_0 = "1.0"
|
||
|
|
"""Initial manifest format with basic structure preservation."""
|
||
|
|
|
||
|
|
V1_1 = "1.1"
|
||
|
|
"""Enhanced manifest with asset tracking and metadata."""
|
||
|
|
|
||
|
|
|
||
|
|
class DetectionConfidence(Enum):
|
||
|
|
"""
|
||
|
|
Confidence levels for variant auto-detection.
|
||
|
|
"""
|
||
|
|
|
||
|
|
HIGH = "high"
|
||
|
|
"""High confidence - manifest found or clear patterns detected."""
|
||
|
|
|
||
|
|
MEDIUM = "medium"
|
||
|
|
"""Medium confidence - some patterns match but ambiguous."""
|
||
|
|
|
||
|
|
LOW = "low"
|
||
|
|
"""Low confidence - minimal patterns, fallback detection."""
|
||
|
|
|
||
|
|
UNKNOWN = "unknown"
|
||
|
|
"""Cannot determine variant - requires manual specification."""
|