added cli
This commit is contained in:
77
docforge/cli/main.pyi
Normal file
77
docforge/cli/main.pyi
Normal file
@@ -0,0 +1,77 @@
|
||||
from typing import Sequence
|
||||
from pathlib import Path
|
||||
|
||||
import click
|
||||
|
||||
|
||||
@click.group()
|
||||
def cli() -> None:
|
||||
"""doc-forge command-line interface."""
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
"--modules",
|
||||
multiple=True,
|
||||
help="Python module import paths to introspect",
|
||||
)
|
||||
@click.option(
|
||||
"--project-name",
|
||||
help="Project name (defaults to first module)",
|
||||
)
|
||||
def tree(
|
||||
modules: Sequence[str],
|
||||
project_name: str | None,
|
||||
) -> None:
|
||||
"""Show introspection tree."""
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
"--modules",
|
||||
multiple=True,
|
||||
help="Python module import paths to document",
|
||||
)
|
||||
@click.option(
|
||||
"--project-name",
|
||||
help="Project name (defaults to first module)",
|
||||
)
|
||||
@click.option(
|
||||
"--docs-dir",
|
||||
type=click.Path(path_type=Path),
|
||||
default=Path("docs"),
|
||||
)
|
||||
def generate(
|
||||
modules: Sequence[str],
|
||||
project_name: str | None,
|
||||
docs_dir: Path,
|
||||
) -> None:
|
||||
"""Generate documentation source files using MkDocs renderer."""
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
"--mkdocs-yml",
|
||||
type=click.Path(path_type=Path),
|
||||
default=Path("mkdocs.yml"),
|
||||
)
|
||||
def build(
|
||||
mkdocs_yml: Path,
|
||||
) -> None:
|
||||
"""Build documentation using MkDocs."""
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
"--mkdocs-yml",
|
||||
type=click.Path(path_type=Path),
|
||||
default=Path("mkdocs.yml"),
|
||||
)
|
||||
def serve(
|
||||
mkdocs_yml: Path,
|
||||
) -> None:
|
||||
"""Serve documentation using MkDocs."""
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""CLI entry point."""
|
||||
Reference in New Issue
Block a user