From c656cfe2cca4a9fa29cd9f05f117ec577c6c1b17 Mon Sep 17 00:00:00 2001 From: Kozo Nishida Date: Mon, 1 Sep 2025 17:59:36 +0900 Subject: [PATCH] docs: enhance documentation with API references and mkdocstrings integration --- .readthedocs.yaml | 6 +++--- docs/api.md | 22 ++++++++++++++++++++++ docs/api/app.md | 5 +++++ docs/api/config.md | 29 +++++++++++++++++++++++++++++ docs/api/core.md | 15 +++++++++++++++ docs/api/mcp_utils.md | 16 ++++++++++++++++ docs/api/ui.md | 23 +++++++++++++++++++++++ docs/requirements.txt | 2 ++ mkdocs.yml | 13 +++++++++++++ 9 files changed, 128 insertions(+), 3 deletions(-) create mode 100644 docs/api.md create mode 100644 docs/api/app.md create mode 100644 docs/api/config.md create mode 100644 docs/api/core.md create mode 100644 docs/api/mcp_utils.md create mode 100644 docs/api/ui.md create mode 100644 docs/requirements.txt diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 9666533..01eae2a 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -17,6 +17,6 @@ mkdocs: # Optionally, but recommended, # declare the Python requirements required to build your documentation # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html -# python: -# install: -# - requirements: docs/requirements.txt +python: + install: + - requirements: docs/requirements.txt diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 0000000..9d69d98 --- /dev/null +++ b/docs/api.md @@ -0,0 +1,22 @@ +# API Reference + +This section contains the complete API reference for the Hatchling project. + +## Overview + +Hatchling is a Python application that provides a chat interface with LLM integration and MCP (Model Context Protocol) support. + +## Package Structure + +- [Core Modules](api/core.md) - Core functionality including chat, LLM, and logging +- [Configuration](api/config.md) - Settings and configuration management +- [UI Components](api/ui.md) - User interface and command handling +- [MCP Utils](api/mcp_utils.md) - Model Context Protocol utilities +- [Main Application](api/app.md) - Main application entry point + +## Quick Start + +```python +from hatchling import app +# See individual module documentation for usage examples +``` diff --git a/docs/api/app.md b/docs/api/app.md new file mode 100644 index 0000000..4e99a12 --- /dev/null +++ b/docs/api/app.md @@ -0,0 +1,5 @@ +# Main Application API + +::: hatchling.app + +This module contains the main entry point for the Hatchling application. diff --git a/docs/api/config.md b/docs/api/config.md new file mode 100644 index 0000000..3108150 --- /dev/null +++ b/docs/api/config.md @@ -0,0 +1,29 @@ +# Configuration API + +::: hatchling.config + +## Settings Management + +::: hatchling.config.settings +::: hatchling.config.settings_registry +::: hatchling.config.settings_access_level + +## LLM Settings + +::: hatchling.config.llm_settings +::: hatchling.config.openai_settings +::: hatchling.config.ollama_settings + +## Other Settings + +::: hatchling.config.path_settings +::: hatchling.config.tool_calling_settings +::: hatchling.config.ui_settings + +## Internationalization + +::: hatchling.config.i18n + +## Languages + +::: hatchling.config.languages diff --git a/docs/api/core.md b/docs/api/core.md new file mode 100644 index 0000000..e32f9ca --- /dev/null +++ b/docs/api/core.md @@ -0,0 +1,15 @@ +# Core Modules API + +::: hatchling.core + +## Chat Module + +::: hatchling.core.chat + +## LLM Module + +::: hatchling.core.llm + +## Logging Module + +::: hatchling.core.logging diff --git a/docs/api/mcp_utils.md b/docs/api/mcp_utils.md new file mode 100644 index 0000000..c8cb663 --- /dev/null +++ b/docs/api/mcp_utils.md @@ -0,0 +1,16 @@ +# MCP Utils API + +::: hatchling.mcp_utils + +## Core MCP Components + +::: hatchling.mcp_utils.client +::: hatchling.mcp_utils.manager +::: hatchling.mcp_utils.mcp_server_api + +## Tool Management + +::: hatchling.mcp_utils.mcp_tool_call_subscriber +::: hatchling.mcp_utils.mcp_tool_data +::: hatchling.mcp_utils.mcp_tool_execution +::: hatchling.mcp_utils.mcp_tool_lifecycle_subscriber diff --git a/docs/api/ui.md b/docs/api/ui.md new file mode 100644 index 0000000..b4a6b25 --- /dev/null +++ b/docs/api/ui.md @@ -0,0 +1,23 @@ +# UI Components API + +::: hatchling.ui + +## Command System + +::: hatchling.ui.abstract_commands +::: hatchling.ui.base_commands +::: hatchling.ui.chat_command_handler +::: hatchling.ui.command_completion +::: hatchling.ui.command_lexer + +## Chat Interface + +::: hatchling.ui.cli_chat +::: hatchling.ui.cli_event_subscriber + +## Specific Commands + +::: hatchling.ui.hatch_commands +::: hatchling.ui.mcp_commands +::: hatchling.ui.model_commands +::: hatchling.ui.settings_commands diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..4a30805 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +mkdocstrings +mkdocstrings-python diff --git a/mkdocs.yml b/mkdocs.yml index 12681d1..5fde821 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -23,12 +23,25 @@ nav: - Event System Architecture: articles/devs/event_system_architecture.md - i18n Support: articles/devs/i18n_support.md - Contributing: articles/devs/CONTRIBUTING.md + - API Reference: api.md - Appendices: - Glossary: articles/appendices/glossary.md - Changelog: CHANGELOG.md plugins: - search + - mkdocstrings: + handlers: + python: + options: + show_source: true + show_root_heading: true + show_root_toc_entry: false + heading_level: 2 + show_category_heading: true + show_labels: true + show_symbol_type_heading: true + show_symbol_type_toc: true markdown_extensions: - admonition