Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,5 +494,3 @@ MailThunder/
## License

This project is licensed under the [MIT License](LICENSE).

Copyright (c) 2021 JE-Chen
86 changes: 86 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# MailThunder Documentation

[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](../LICENSE)
[![Python](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://www.python.org/)
[![PyPI](https://img.shields.io/pypi/v/je_mail_thunder)](https://pypi.org/project/je-mail-thunder/)
[![Read the Docs](https://readthedocs.org/projects/mailthunder/badge/?version=latest)](https://mailthunder.readthedocs.io/)
[![Main README](https://img.shields.io/badge/Main-README-green.svg)](../README.md)
[![GitHub](https://img.shields.io/badge/GitHub-Repository-black.svg)](https://github.com/Integration-Automation/MailThunder)

This directory contains the [Read the Docs](https://readthedocs.io/) Sphinx documentation source for **MailThunder**.

For the full project overview, see the [Main README](../README.md).

---

## Documentation Structure

```
docs/
README.md # This file
Makefile # Unix build script
make.bat # Windows build script
requirements.txt # Sphinx dependencies
source/
conf.py # Sphinx configuration
index.rst # Root page (toctree entry point)
docs/
Eng/ # English documentation
eng_index.rst # Overview & architecture
installation.rst # Installation guide
authentication.rst # Authentication setup
send_google_mail.rst # Sending emails (SMTP)
read_google_mail.rst # Reading emails (IMAP)
scripting_engine.rst # JSON scripting engine
project_templates.rst # Project template scaffolding
cli.rst # Command-line interface
socket_server.rst # TCP socket server
package_manager.rst # Dynamic package loader
logging.rst # Logging system
exceptions.rst # Custom exceptions
Zh/ # 繁體中文文件
zh_index.rst # 總覽與架構
installation.rst # 安裝指南
authentication.rst # 認證設定
send_google_mail.rst # 寄送郵件 (SMTP)
read_google_mail.rst # 讀取郵件 (IMAP)
scripting_engine.rst # JSON 腳本引擎
project_templates.rst # 專案模板
cli.rst # 命令列介面
socket_server.rst # Socket 伺服器
package_manager.rst # 套件管理器
logging.rst # 日誌記錄
exceptions.rst # 例外處理
API/ # API reference
api_index.rst # Public exports & module map
smtp_api.rst # SMTPWrapper API
imap_api.rst # IMAPWrapper API
executor_api.rst # Executor API
utils_api.rst # Utility functions API
```

---

## Building Locally

```bash
pip install -r docs/requirements.txt
cd docs
make html # Linux / macOS
make.bat html # Windows
```

Open `docs/build/html/index.html` in your browser.

---

## Read the Docs Configuration

Configured via `.readthedocs.yaml` in the project root:

| Setting | Value |
|---------|-------|
| Build OS | `ubuntu-22.04` |
| Python | `3.11` |
| Sphinx config | `docs/source/conf.py` |
| Theme | `sphinx-rtd-theme` |
28 changes: 9 additions & 19 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# For the full list of configuration options see:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
from pathlib import Path
Expand All @@ -26,27 +21,22 @@

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named "sphinx.ext.*") or your custom
# ones.
extensions = []

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

# -- Options for sphinx_rtd_theme --------------------------------------------

html_theme_options = {
"navigation_depth": 4,
"collapse_navigation": False,
"titles_only": False,
}
87 changes: 82 additions & 5 deletions docs/source/docs/API/api_index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,86 @@
MailThunder API
API Reference
=============

This section provides the complete API reference for all public classes, methods,
and functions in MailThunder.

Public Exports
--------------

All public APIs are accessible from the top-level ``je_mail_thunder`` package:

.. code-block:: python

from je_mail_thunder import (
# SMTP
SMTPWrapper, # SMTP wrapper class
smtp_instance, # Pre-created SMTP instance (or None)

# IMAP
IMAPWrapper, # IMAP wrapper class
imap_instance, # Pre-created IMAP instance (or None)

# Authentication
set_mail_thunder_os_environ, # Set auth env vars
get_mail_thunder_os_environ, # Get auth env vars
mail_thunder_content_data_dict, # Global credential dict
is_need_to_save_content, # Check if credentials need saving
read_output_content, # Read mail_thunder_content.json
write_output_content, # Write mail_thunder_content.json

# Executor
execute_action, # Execute action list
execute_files, # Execute multiple action files
add_command_to_executor, # Register custom commands

# JSON
read_action_json, # Read JSON action file

# File Utilities
get_dir_files_as_list, # List directory files

# Project
create_project_dir, # Scaffold project with templates
)

----

.. toctree::
:maxdepth: 4
Module Map
----------

imap_api.rst
smtp_api.rst
.. list-table::
:header-rows: 1
:widths: 40 60

* - Import Path
- Description
* - ``je_mail_thunder.smtp.smtp_wrapper``
- ``SMTPWrapper`` class, ``smtp_instance``
* - ``je_mail_thunder.imap.imap_wrapper``
- ``IMAPWrapper`` class, ``imap_instance``
* - ``je_mail_thunder.utils.executor.action_executor``
- ``Executor`` class, ``execute_action()``, ``execute_files()``, ``add_command_to_executor()``
* - ``je_mail_thunder.utils.save_mail_user_content.save_on_env``
- ``set_mail_thunder_os_environ()``, ``get_mail_thunder_os_environ()``
* - ``je_mail_thunder.utils.save_mail_user_content.mail_thunder_content_save``
- ``read_output_content()``, ``write_output_content()``
* - ``je_mail_thunder.utils.save_mail_user_content.mail_thunder_content_data``
- ``mail_thunder_content_data_dict``, ``is_need_to_save_content()``
* - ``je_mail_thunder.utils.json.json_file``
- ``read_action_json()``, ``write_action_json()``
* - ``je_mail_thunder.utils.json_format.json_process``
- ``reformat_json()``
* - ``je_mail_thunder.utils.file_process.get_dir_file_list``
- ``get_dir_files_as_list()``
* - ``je_mail_thunder.utils.project.create_project_structure``
- ``create_project_dir()``
* - ``je_mail_thunder.utils.package_manager.package_manager_class``
- ``PackageManager`` class, ``package_manager``
* - ``je_mail_thunder.utils.socket_server.mail_thunder_socket_server``
- ``TCPServer``, ``TCPServerHandler``, ``start_autocontrol_socket_server()``
* - ``je_mail_thunder.utils.logging.loggin_instance``
- ``mail_thunder_logger``
* - ``je_mail_thunder.utils.exception.exceptions``
- All custom exception classes
* - ``je_mail_thunder.utils.exception.exception_tags``
- Error tag strings
Loading
Loading