2026-05-03 21:37:00 +02:00
|
|
|
"""Structured markdown primitives for markitect-tool."""
|
|
|
|
|
|
|
|
|
|
from markitect_tool.core import (
|
|
|
|
|
ContentBlock,
|
|
|
|
|
Document,
|
|
|
|
|
Heading,
|
|
|
|
|
MarkdownParseError,
|
|
|
|
|
Section,
|
|
|
|
|
parse_markdown,
|
|
|
|
|
parse_markdown_file,
|
|
|
|
|
)
|
2026-05-03 22:51:13 +02:00
|
|
|
from markitect_tool.contract import (
|
|
|
|
|
ContractCheckResult,
|
|
|
|
|
ContractValidationResult,
|
|
|
|
|
DocumentContract,
|
|
|
|
|
check_document_contract,
|
|
|
|
|
check_markdown_file,
|
|
|
|
|
collect_metrics,
|
|
|
|
|
load_contract_file,
|
|
|
|
|
validate_contract,
|
|
|
|
|
validate_contract_file,
|
|
|
|
|
)
|
2026-05-04 01:35:32 +02:00
|
|
|
from markitect_tool.cache import (
|
|
|
|
|
CacheEntry,
|
|
|
|
|
CacheManifest,
|
|
|
|
|
CacheStatus,
|
|
|
|
|
build_cache,
|
|
|
|
|
cache_path_for,
|
|
|
|
|
detect_changes,
|
|
|
|
|
fingerprint_file,
|
|
|
|
|
load_cache,
|
|
|
|
|
save_cache,
|
|
|
|
|
scan_markdown_files,
|
|
|
|
|
)
|
2026-05-04 02:43:32 +02:00
|
|
|
from markitect_tool.backend import (
|
|
|
|
|
BACKEND_CAPABILITIES,
|
|
|
|
|
DEFAULT_BACKEND_PATHS,
|
|
|
|
|
AccessPolicyGateway,
|
|
|
|
|
BackendCapabilityCheck,
|
|
|
|
|
BackendManifest,
|
|
|
|
|
BackendRegistry,
|
|
|
|
|
BackendRegistryError,
|
|
|
|
|
ContextPackageRegistry,
|
|
|
|
|
DependencyEdge,
|
|
|
|
|
DocumentSnapshot,
|
|
|
|
|
IndexBackend,
|
|
|
|
|
ProcessorResultStore,
|
|
|
|
|
ProvenanceEnvelope,
|
|
|
|
|
QueryAdapter,
|
|
|
|
|
SnapshotBackend,
|
|
|
|
|
SnapshotIdentity,
|
|
|
|
|
capability_check,
|
|
|
|
|
load_backend_manifest,
|
|
|
|
|
load_backend_registry,
|
|
|
|
|
snapshot_identity_for_file,
|
|
|
|
|
)
|
2026-05-04 02:25:49 +02:00
|
|
|
from markitect_tool.content_class import (
|
|
|
|
|
ClassCompositionResult,
|
|
|
|
|
ContentClass,
|
|
|
|
|
ContentClassRegistry,
|
|
|
|
|
ContentClassResolutionError,
|
|
|
|
|
load_content_class_file,
|
|
|
|
|
load_content_classes,
|
|
|
|
|
)
|
2026-05-03 22:51:13 +02:00
|
|
|
from markitect_tool.diagnostics import Diagnostic, SourceLocation
|
2026-05-04 02:25:49 +02:00
|
|
|
from markitect_tool.explode import (
|
|
|
|
|
EXPLODE_MANIFEST_NAME,
|
|
|
|
|
ExplodeEntry,
|
|
|
|
|
ExplodeError,
|
|
|
|
|
ExplodeManifest,
|
|
|
|
|
ExplodeResult,
|
|
|
|
|
ImplodeResult,
|
|
|
|
|
explode_markdown_file,
|
|
|
|
|
implode_markdown_directory,
|
|
|
|
|
load_explode_manifest,
|
|
|
|
|
)
|
2026-05-04 01:12:54 +02:00
|
|
|
from markitect_tool.generation import (
|
|
|
|
|
GeneratedDocument,
|
|
|
|
|
GenerationHookRequest,
|
|
|
|
|
GenerationHookResult,
|
|
|
|
|
GenerationPlan,
|
|
|
|
|
GenerationResult,
|
|
|
|
|
generate_stub_from_contract,
|
|
|
|
|
generate_with_hook,
|
|
|
|
|
load_generation_plan_file,
|
|
|
|
|
run_generation_plan,
|
|
|
|
|
)
|
2026-05-04 02:25:49 +02:00
|
|
|
from markitect_tool.literate import (
|
|
|
|
|
CodeChunk,
|
|
|
|
|
LiterateFile,
|
|
|
|
|
TangleResult,
|
|
|
|
|
WeaveResult,
|
|
|
|
|
discover_code_chunks,
|
|
|
|
|
tangle_markdown,
|
|
|
|
|
weave_markdown,
|
|
|
|
|
write_tangle_files,
|
|
|
|
|
)
|
2026-05-04 00:23:04 +02:00
|
|
|
from markitect_tool.ops import (
|
|
|
|
|
ComposeResult,
|
|
|
|
|
IncludeError,
|
|
|
|
|
IncludeResult,
|
2026-05-04 02:25:49 +02:00
|
|
|
OperationProvenance,
|
2026-05-04 00:23:04 +02:00
|
|
|
TransformResult,
|
|
|
|
|
compose_files,
|
|
|
|
|
resolve_includes,
|
|
|
|
|
transform_markdown,
|
|
|
|
|
)
|
2026-05-04 02:25:49 +02:00
|
|
|
from markitect_tool.processor import (
|
|
|
|
|
FencedProcessorBlock,
|
|
|
|
|
ProcessorContext,
|
|
|
|
|
ProcessorOutputFile,
|
|
|
|
|
ProcessorRegistry,
|
|
|
|
|
ProcessorRequest,
|
|
|
|
|
ProcessorResult,
|
|
|
|
|
ProcessorRun,
|
|
|
|
|
default_processor_registry,
|
|
|
|
|
discover_fenced_processors,
|
|
|
|
|
run_fenced_processors,
|
|
|
|
|
)
|
2026-05-04 00:12:07 +02:00
|
|
|
from markitect_tool.query import (
|
|
|
|
|
InvalidQueryError,
|
|
|
|
|
QueryMatch,
|
|
|
|
|
extract_document,
|
|
|
|
|
query_document,
|
|
|
|
|
)
|
2026-05-04 02:25:49 +02:00
|
|
|
from markitect_tool.reference import (
|
|
|
|
|
ContentUnit,
|
|
|
|
|
ReferenceAddress,
|
|
|
|
|
ReferenceContext,
|
|
|
|
|
ReferenceResolution,
|
|
|
|
|
ReferenceResolutionError,
|
|
|
|
|
SourceSpan as ReferenceSourceSpan,
|
|
|
|
|
load_namespaces,
|
|
|
|
|
parse_reference,
|
|
|
|
|
resolve_reference,
|
|
|
|
|
)
|
2026-05-03 22:12:46 +02:00
|
|
|
from markitect_tool.schema import (
|
|
|
|
|
MarkdownSchema,
|
|
|
|
|
SchemaValidationResult,
|
|
|
|
|
ValidationViolation,
|
|
|
|
|
load_schema_file,
|
|
|
|
|
validate_document,
|
|
|
|
|
validate_markdown_file,
|
|
|
|
|
)
|
2026-05-04 01:12:54 +02:00
|
|
|
from markitect_tool.template import (
|
|
|
|
|
MissingTemplateVariable,
|
|
|
|
|
TemplateAnalysis,
|
|
|
|
|
TemplateError,
|
|
|
|
|
TemplateRenderResult,
|
|
|
|
|
analyze_template,
|
|
|
|
|
render_template,
|
|
|
|
|
)
|
2026-05-03 21:37:00 +02:00
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
|
"ContentBlock",
|
|
|
|
|
"Document",
|
|
|
|
|
"Heading",
|
|
|
|
|
"MarkdownParseError",
|
|
|
|
|
"Section",
|
|
|
|
|
"parse_markdown",
|
|
|
|
|
"parse_markdown_file",
|
2026-05-03 22:12:46 +02:00
|
|
|
"MarkdownSchema",
|
|
|
|
|
"SchemaValidationResult",
|
|
|
|
|
"ValidationViolation",
|
|
|
|
|
"load_schema_file",
|
|
|
|
|
"validate_document",
|
|
|
|
|
"validate_markdown_file",
|
2026-05-03 22:51:13 +02:00
|
|
|
"ContractCheckResult",
|
|
|
|
|
"ContractValidationResult",
|
|
|
|
|
"DocumentContract",
|
|
|
|
|
"check_document_contract",
|
|
|
|
|
"check_markdown_file",
|
|
|
|
|
"collect_metrics",
|
|
|
|
|
"load_contract_file",
|
|
|
|
|
"validate_contract",
|
|
|
|
|
"validate_contract_file",
|
2026-05-04 01:35:32 +02:00
|
|
|
"CacheEntry",
|
|
|
|
|
"CacheManifest",
|
|
|
|
|
"CacheStatus",
|
|
|
|
|
"build_cache",
|
|
|
|
|
"cache_path_for",
|
|
|
|
|
"detect_changes",
|
|
|
|
|
"fingerprint_file",
|
|
|
|
|
"load_cache",
|
|
|
|
|
"save_cache",
|
|
|
|
|
"scan_markdown_files",
|
2026-05-04 02:43:32 +02:00
|
|
|
"BACKEND_CAPABILITIES",
|
|
|
|
|
"DEFAULT_BACKEND_PATHS",
|
|
|
|
|
"AccessPolicyGateway",
|
|
|
|
|
"BackendCapabilityCheck",
|
|
|
|
|
"BackendManifest",
|
|
|
|
|
"BackendRegistry",
|
|
|
|
|
"BackendRegistryError",
|
|
|
|
|
"ContextPackageRegistry",
|
|
|
|
|
"DependencyEdge",
|
|
|
|
|
"DocumentSnapshot",
|
|
|
|
|
"IndexBackend",
|
|
|
|
|
"ProcessorResultStore",
|
|
|
|
|
"ProvenanceEnvelope",
|
|
|
|
|
"QueryAdapter",
|
|
|
|
|
"SnapshotBackend",
|
|
|
|
|
"SnapshotIdentity",
|
|
|
|
|
"capability_check",
|
|
|
|
|
"load_backend_manifest",
|
|
|
|
|
"load_backend_registry",
|
|
|
|
|
"snapshot_identity_for_file",
|
2026-05-04 02:25:49 +02:00
|
|
|
"ClassCompositionResult",
|
|
|
|
|
"ContentClass",
|
|
|
|
|
"ContentClassRegistry",
|
|
|
|
|
"ContentClassResolutionError",
|
|
|
|
|
"load_content_class_file",
|
|
|
|
|
"load_content_classes",
|
2026-05-03 22:51:13 +02:00
|
|
|
"Diagnostic",
|
|
|
|
|
"SourceLocation",
|
2026-05-04 02:25:49 +02:00
|
|
|
"EXPLODE_MANIFEST_NAME",
|
|
|
|
|
"ExplodeEntry",
|
|
|
|
|
"ExplodeError",
|
|
|
|
|
"ExplodeManifest",
|
|
|
|
|
"ExplodeResult",
|
|
|
|
|
"ImplodeResult",
|
|
|
|
|
"explode_markdown_file",
|
|
|
|
|
"implode_markdown_directory",
|
|
|
|
|
"load_explode_manifest",
|
2026-05-04 01:12:54 +02:00
|
|
|
"GeneratedDocument",
|
|
|
|
|
"GenerationHookRequest",
|
|
|
|
|
"GenerationHookResult",
|
|
|
|
|
"GenerationPlan",
|
|
|
|
|
"GenerationResult",
|
|
|
|
|
"generate_stub_from_contract",
|
|
|
|
|
"generate_with_hook",
|
|
|
|
|
"load_generation_plan_file",
|
|
|
|
|
"run_generation_plan",
|
2026-05-04 02:25:49 +02:00
|
|
|
"CodeChunk",
|
|
|
|
|
"LiterateFile",
|
|
|
|
|
"TangleResult",
|
|
|
|
|
"WeaveResult",
|
|
|
|
|
"discover_code_chunks",
|
|
|
|
|
"tangle_markdown",
|
|
|
|
|
"weave_markdown",
|
|
|
|
|
"write_tangle_files",
|
2026-05-04 00:23:04 +02:00
|
|
|
"ComposeResult",
|
|
|
|
|
"IncludeError",
|
|
|
|
|
"IncludeResult",
|
2026-05-04 02:25:49 +02:00
|
|
|
"OperationProvenance",
|
2026-05-04 00:23:04 +02:00
|
|
|
"TransformResult",
|
|
|
|
|
"compose_files",
|
|
|
|
|
"resolve_includes",
|
|
|
|
|
"transform_markdown",
|
2026-05-04 02:25:49 +02:00
|
|
|
"FencedProcessorBlock",
|
|
|
|
|
"ProcessorContext",
|
|
|
|
|
"ProcessorOutputFile",
|
|
|
|
|
"ProcessorRegistry",
|
|
|
|
|
"ProcessorRequest",
|
|
|
|
|
"ProcessorResult",
|
|
|
|
|
"ProcessorRun",
|
|
|
|
|
"default_processor_registry",
|
|
|
|
|
"discover_fenced_processors",
|
|
|
|
|
"run_fenced_processors",
|
2026-05-04 00:12:07 +02:00
|
|
|
"InvalidQueryError",
|
|
|
|
|
"QueryMatch",
|
|
|
|
|
"extract_document",
|
|
|
|
|
"query_document",
|
2026-05-04 02:25:49 +02:00
|
|
|
"ContentUnit",
|
|
|
|
|
"ReferenceAddress",
|
|
|
|
|
"ReferenceContext",
|
|
|
|
|
"ReferenceResolution",
|
|
|
|
|
"ReferenceResolutionError",
|
|
|
|
|
"ReferenceSourceSpan",
|
|
|
|
|
"load_namespaces",
|
|
|
|
|
"parse_reference",
|
|
|
|
|
"resolve_reference",
|
2026-05-04 01:12:54 +02:00
|
|
|
"MissingTemplateVariable",
|
|
|
|
|
"TemplateAnalysis",
|
|
|
|
|
"TemplateError",
|
|
|
|
|
"TemplateRenderResult",
|
|
|
|
|
"analyze_template",
|
|
|
|
|
"render_template",
|
2026-05-03 21:37:00 +02:00
|
|
|
]
|