Add field manual generator — produces structured Markdown operator reference from extracted intel
This commit is contained in:
@@ -826,6 +826,35 @@ def _run_verify(db, output_dir: str, source: Optional[str] = None):
|
||||
console.print("\n[green]All cached files passed integrity checks.[/green]")
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# manual
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@cli.command()
|
||||
@click.option("--output", "-o", type=click.Path(), default="output/FIELD_MANUAL.md",
|
||||
help="Output file path.")
|
||||
@click.option("--title", type=str, default="Operator's Field Manual",
|
||||
help="Manual title.")
|
||||
@click.pass_context
|
||||
def manual(ctx, output, title):
|
||||
"""Generate Markdown field manual from extracted intelligence."""
|
||||
from analysis.field_manual import generate_field_manual
|
||||
|
||||
db = open_db(ctx.obj["db_path"])
|
||||
try:
|
||||
path = generate_field_manual(db, output_path=output, title=title)
|
||||
console.print(f"\n[bold green]Field manual generated:[/bold green] {path}")
|
||||
|
||||
# Show stats
|
||||
import os
|
||||
size = os.path.getsize(path)
|
||||
with open(path) as f:
|
||||
lines = sum(1 for _ in f)
|
||||
console.print(f" Size: {size:,} bytes ({lines:,} lines)")
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# sources
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user