30 lines
826 B
Python
30 lines
826 B
Python
|
|
"""
|
||
|
|
Markdown normalizer — passes through Markdown with minimal transformation.
|
||
|
|
|
||
|
|
No external dependencies required.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
from markitect.proxy.extractors.base import BaseExtractor
|
||
|
|
from markitect.proxy.models import ExtractionResult
|
||
|
|
|
||
|
|
|
||
|
|
class MarkdownNormalizer(BaseExtractor):
|
||
|
|
"""Normalizes other Markdown files (built-in, no optional deps)."""
|
||
|
|
|
||
|
|
name = "markdown"
|
||
|
|
version = "1.0"
|
||
|
|
extensions = (".md", ".markdown", ".mdown")
|
||
|
|
|
||
|
|
def check_dependencies(self) -> bool:
|
||
|
|
return True
|
||
|
|
|
||
|
|
def extract(self, source_path: Path) -> ExtractionResult:
|
||
|
|
content = source_path.read_text(encoding="utf-8")
|
||
|
|
return ExtractionResult(
|
||
|
|
content=content,
|
||
|
|
extractor=self.name,
|
||
|
|
extractor_version=self.version,
|
||
|
|
)
|