diff options
29 files changed, 357 insertions, 0 deletions
diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..6d62693e --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,32 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.10" + # You can also specify other tool versions: + # nodejs: "19" + # rust: "1.64" + # golang: "1.19" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/source/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +formats: + - pdf + - epub + +# Optional 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
\ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..da9741cb --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +# 社区贡献指引
\ No newline at end of file @@ -1,5 +1,6 @@ # Infini Generator 2 +<!-- start index --> Infini 文本输入输出流 2 ## 版本 @@ -9,3 +10,4 @@ Infini 文本输入输出流 2 ## 版权 水系 × [浊莲](https://github.com/noctisynth)依照 MIT 协议开源 Infini。 +<!-- end index -->
\ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..fc249071 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,26 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build +SPHINXINTL ?= sphinx-intl +lang ?= zh_CN + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +# update translation command +translate: + @$(SPHINXINTL) update -p ./build/gettext -l $(lang) $(O)
\ No newline at end of file diff --git a/docs/_static/logo.png b/docs/_static/logo.png Binary files differnew file mode 100644 index 00000000..8b5a14c8 --- /dev/null +++ b/docs/_static/logo.png diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..d276c4d0 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,8 @@ +furo>=2023.3.27 +sphinx-autobuild>=2021.3.14 +myst-parser>=0.18.1 +sphinx>=5.3.0 +infini +tomli +sphinx_design +sphinx-intl>=2.1.0
\ No newline at end of file diff --git a/docs/source/CONTRIBUTING.md b/docs/source/CONTRIBUTING.md new file mode 100644 index 00000000..e75758cf --- /dev/null +++ b/docs/source/CONTRIBUTING.md @@ -0,0 +1,2 @@ +```{include} ../../CONTRIBUTING.md +```
\ No newline at end of file diff --git a/docs/source/changelog.md b/docs/source/changelog.md new file mode 100644 index 00000000..efc8cca8 --- /dev/null +++ b/docs/source/changelog.md @@ -0,0 +1,12 @@ +# 变更日志 + +<!-- + +Version codenames style: + +date "+## %Y.%m.%d -- {adjective} {colorname}" | pbcopy + +https://patternbasedwriting.com/elementary_writing_success/list-4800-adjectives/ +https://en.wikipedia.org/wiki/Lists_of_colors + +--> diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000..c2403d47 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,95 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +import infini +import os, sys + +if sys.version_info >= (3, 11): + import tomllib +else: + import tomli as tomllib + +DATA = None +PYPROJECT = os.path.join("..", "..", "pyproject.toml") +with open(PYPROJECT, "r", encoding="utf8") as f: + pyproject = f.read() + DATA = tomllib.loads(pyproject) +PROJECT_VERSION = DATA["project"]["version"] +PROJECT_NAME = DATA["project"]["name"] +AUTHOR_TABLE = DATA["project"]["authors"] +AUTHORS = ",".join([f"{aut['name']}<{aut['email']}>" for aut in AUTHOR_TABLE]) + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = PROJECT_NAME # "IamAI" +release = PROJECT_VERSION # "latest" +copyright = "2023-PRESENT, HydroRoll-Team." +author = "Hsiang Nianian" # AUTHORS + +# html_title = "Who am I? I am AI." + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.viewcode", + "sphinx.ext.todo", + "sphinx.ext.napoleon", + "sphinx.ext.autosummary", + "sphinx.ext.extlinks", + "myst_parser", +] + +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] +extlinks = { + "issue": ("https://github.com/HydroRoll-Team/infini/%s", "issue %s"), + "doc": ("https://grps.hydroroll.team/zh_CN/latest/%s", "pages/%s"), +} +source_suffix = { + ".rst": "restructuredtext", + ".txt": "markdown", + ".md": "markdown", +} + +locale_dirs = ["../locales/"] # path is example but recommended. +gettext_compact = False # optional. +gettext_uuid = True # optional. + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "furo" +html_static_path = ["../_static"] +html_logo = "https://cdn.jsdelivr.net/gh/HydroRoll-Team/infini@master/docs/_static/logo.png" +html_favicon = html_logo + +html_css_files = [ + "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/fontawesome.min.css", + "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/brands.min.css", +] + +html_theme_options = { + "announcement": "<em><a href='#'>documentation</a> is still under construction now, welcome any <a href='contributing.html'>contribution</a>!</em>", + "source_repository": "https://github.com/HydroRoll-Team/infini/", + "source_branch": "master", + "source_directory": "docs/source/", + "footer_icons": [ + { + "name": "GitHub", + "url": "https://github.com/HydroRoll-Team/infini/", + "html": "", + "class": "fa-brands fa-github", + }, + { + "name": "Pypi", + "url": "https://pypi.org/project/infini/", + "html": "", + "class": "fa-brands fa-python", + }, + ], +}
\ No newline at end of file diff --git a/docs/source/index.md b/docs/source/index.md new file mode 100644 index 00000000..cd1a0d36 --- /dev/null +++ b/docs/source/index.md @@ -0,0 +1,39 @@ +--- +hide-toc: true +--- + +# Infini Generator 2 + +```{include} ../../README.md +:start-after: <!-- start index --> +:end-before: <!-- end index --> +``` + +```{toctree} +:hidden: + +快速开始 <quick-start> +``` + +```{toctree} +:caption: 通用规则包标准 +:hidden: + +pages/grps-1/index +``` + +```{toctree} +:caption: API 接口 +:hidden: + +源码文档 <pages/api/index> +``` + +```{toctree} +:caption: 开发手册 +:hidden: + +社区贡献指引 <CONTRIBUTING> +变更日志 <changelog> +协议 <license> +```
\ No newline at end of file diff --git a/docs/source/license.md b/docs/source/license.md new file mode 100644 index 00000000..1d1521fe --- /dev/null +++ b/docs/source/license.md @@ -0,0 +1,2 @@ +```{include} ../../LICENSE +```
\ No newline at end of file diff --git a/docs/source/pages/api/index.rst b/docs/source/pages/api/index.rst new file mode 100644 index 00000000..704f2ae9 --- /dev/null +++ b/docs/source/pages/api/index.rst @@ -0,0 +1,7 @@ +infini +====== + +.. toctree:: + :maxdepth: 4 + + infini diff --git a/docs/source/pages/api/infini.core.rst b/docs/source/pages/api/infini.core.rst new file mode 100644 index 00000000..084db942 --- /dev/null +++ b/docs/source/pages/api/infini.core.rst @@ -0,0 +1,7 @@ +infini.core module +================== + +.. automodule:: infini.core + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.exceptions.rst b/docs/source/pages/api/infini.exceptions.rst new file mode 100644 index 00000000..bdc8ef66 --- /dev/null +++ b/docs/source/pages/api/infini.exceptions.rst @@ -0,0 +1,7 @@ +infini.exceptions module +======================== + +.. automodule:: infini.exceptions + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.generator.rst b/docs/source/pages/api/infini.generator.rst new file mode 100644 index 00000000..c5055fff --- /dev/null +++ b/docs/source/pages/api/infini.generator.rst @@ -0,0 +1,7 @@ +infini.generator module +======================= + +.. automodule:: infini.generator + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.handler.rst b/docs/source/pages/api/infini.handler.rst new file mode 100644 index 00000000..5b7742cc --- /dev/null +++ b/docs/source/pages/api/infini.handler.rst @@ -0,0 +1,7 @@ +infini.handler module +===================== + +.. automodule:: infini.handler + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.input.rst b/docs/source/pages/api/infini.input.rst new file mode 100644 index 00000000..184a0b07 --- /dev/null +++ b/docs/source/pages/api/infini.input.rst @@ -0,0 +1,7 @@ +infini.input module +=================== + +.. automodule:: infini.input + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.interceptor.rst b/docs/source/pages/api/infini.interceptor.rst new file mode 100644 index 00000000..fa990394 --- /dev/null +++ b/docs/source/pages/api/infini.interceptor.rst @@ -0,0 +1,7 @@ +infini.interceptor module +========================= + +.. automodule:: infini.interceptor + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.internal.rst b/docs/source/pages/api/infini.internal.rst new file mode 100644 index 00000000..e0abeb40 --- /dev/null +++ b/docs/source/pages/api/infini.internal.rst @@ -0,0 +1,7 @@ +infini.internal module +====================== + +.. automodule:: infini.internal + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.loader.rst b/docs/source/pages/api/infini.loader.rst new file mode 100644 index 00000000..29d58321 --- /dev/null +++ b/docs/source/pages/api/infini.loader.rst @@ -0,0 +1,7 @@ +infini.loader module +==================== + +.. automodule:: infini.loader + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.logging.rst b/docs/source/pages/api/infini.logging.rst new file mode 100644 index 00000000..8aa76357 --- /dev/null +++ b/docs/source/pages/api/infini.logging.rst @@ -0,0 +1,7 @@ +infini.logging module +===================== + +.. automodule:: infini.logging + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.output.rst b/docs/source/pages/api/infini.output.rst new file mode 100644 index 00000000..33ec78fc --- /dev/null +++ b/docs/source/pages/api/infini.output.rst @@ -0,0 +1,7 @@ +infini.output module +==================== + +.. automodule:: infini.output + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.queue.rst b/docs/source/pages/api/infini.queue.rst new file mode 100644 index 00000000..19401f43 --- /dev/null +++ b/docs/source/pages/api/infini.queue.rst @@ -0,0 +1,7 @@ +infini.queue module +=================== + +.. automodule:: infini.queue + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.register.rst b/docs/source/pages/api/infini.register.rst new file mode 100644 index 00000000..8719967e --- /dev/null +++ b/docs/source/pages/api/infini.register.rst @@ -0,0 +1,7 @@ +infini.register module +====================== + +.. automodule:: infini.register + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.router.rst b/docs/source/pages/api/infini.router.rst new file mode 100644 index 00000000..512aa450 --- /dev/null +++ b/docs/source/pages/api/infini.router.rst @@ -0,0 +1,7 @@ +infini.router module +==================== + +.. automodule:: infini.router + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.rst b/docs/source/pages/api/infini.rst new file mode 100644 index 00000000..dbc0cd20 --- /dev/null +++ b/docs/source/pages/api/infini.rst @@ -0,0 +1,31 @@ +infini package +============== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + infini.core + infini.exceptions + infini.generator + infini.handler + infini.input + infini.interceptor + infini.internal + infini.loader + infini.logging + infini.output + infini.queue + infini.register + infini.router + infini.typing + +Module contents +--------------- + +.. automodule:: infini + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/api/infini.typing.rst b/docs/source/pages/api/infini.typing.rst new file mode 100644 index 00000000..cb134292 --- /dev/null +++ b/docs/source/pages/api/infini.typing.rst @@ -0,0 +1,7 @@ +infini.typing module +==================== + +.. automodule:: infini.typing + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/grps-1/index.md b/docs/source/pages/grps-1/index.md new file mode 100644 index 00000000..d56fffd9 --- /dev/null +++ b/docs/source/pages/grps-1/index.md @@ -0,0 +1 @@ +# 通用规则包标准
\ No newline at end of file diff --git a/docs/source/quick-start.md b/docs/source/quick-start.md new file mode 100644 index 00000000..55b6f79f --- /dev/null +++ b/docs/source/quick-start.md @@ -0,0 +1 @@ +# 快速开始
\ No newline at end of file |
