aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2024-02-28 11:02:45 +0800
committer简律纯 <i@jyunko.cn>2024-02-28 11:02:45 +0800
commit67a4e90568903200102ca369e3522d9093877277 (patch)
treee52cd931915e1358d1b5ee181656065cc9b9738b
parent357db22d9cac9e40d7364f0a9b6606b130382210 (diff)
downloadHydroRoll-67a4e90568903200102ca369e3522d9093877277.tar.gz
HydroRoll-67a4e90568903200102ca369e3522d9093877277.zip
feat(docs): enable docs preview
-rw-r--r--.readthedocs.yaml32
-rw-r--r--Cargo.toml1
-rw-r--r--README.rst4
-rw-r--r--docs/Makefile26
-rw-r--r--docs/_static/logo.pngbin0 -> 235361 bytes
-rw-r--r--docs/requirements.txt7
-rw-r--r--docs/source/changelog.md13
-rw-r--r--docs/source/conf.py97
-rw-r--r--docs/source/index.rst40
-rw-r--r--docs/source/pages/api/index.rst7
-rw-r--r--docs/source/pages/api/infini.core.rst7
-rw-r--r--docs/source/pages/api/infini.exceptions.rst7
-rw-r--r--docs/source/pages/api/infini.generator.rst7
-rw-r--r--docs/source/pages/api/infini.handler.rst7
-rw-r--r--docs/source/pages/api/infini.input.rst7
-rw-r--r--docs/source/pages/api/infini.interceptor.rst7
-rw-r--r--docs/source/pages/api/infini.internal.rst7
-rw-r--r--docs/source/pages/api/infini.loader.rst7
-rw-r--r--docs/source/pages/api/infini.logging.rst7
-rw-r--r--docs/source/pages/api/infini.output.rst7
-rw-r--r--docs/source/pages/api/infini.queue.rst7
-rw-r--r--docs/source/pages/api/infini.register.rst7
-rw-r--r--docs/source/pages/api/infini.router.rst7
-rw-r--r--docs/source/pages/api/infini.rst31
-rw-r--r--docs/source/pages/api/infini.typing.rst7
-rw-r--r--docs/source/pages/grps-1/index.md1
26 files changed, 357 insertions, 0 deletions
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644
index 0000000..6d62693
--- /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/Cargo.toml b/Cargo.toml
index cd641b2..1629639 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,6 +7,7 @@ license = "MIT"
documentation = "https://docs.hydroroll.team/"
homepage = "https://hydroroll.team/"
repository = "https://github.com/HydroRoll-Team/HydroRoll"
+authors = ["HsiangNianian <i@jyunko.c"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
diff --git a/README.rst b/README.rst
index 69415c4..6a48db5 100644
--- a/README.rst
+++ b/README.rst
@@ -6,6 +6,8 @@
:width: 60
:align: right
+.. start-index
+
跨平台、多模态、高度自定义的骰系开发框架
==================================
@@ -26,6 +28,8 @@
- 🎢 渐进式学习框架,从编写简单的 nivis reply脚本,到编写满足小需求的 lua、python脚本,再到成为世界主编写自己的规则包模块,甚至训练水系模型,层层递进,轻松学习。
- 🔓 更多特性等你发掘!
+.. end-index
+
安装与使用
-----
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..fc24907
--- /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
new file mode 100644
index 0000000..8b5a14c
--- /dev/null
+++ b/docs/_static/logo.png
Binary files differ
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 0000000..899492a
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1,7 @@
+furo>=2023.3.27
+sphinx-autobuild>=2021.3.14
+myst-parser>=0.18.1
+sphinx>=5.3.0
+tomli
+sphinx_design
+sphinx-intl>=2.1.0 \ No newline at end of file
diff --git a/docs/source/changelog.md b/docs/source/changelog.md
new file mode 100644
index 0000000..769b66e
--- /dev/null
+++ b/docs/source/changelog.md
@@ -0,0 +1,13 @@
+<!--
+
+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
+
+-->
+
+```{include} ../../CHANGELOG.md
+``` \ No newline at end of file
diff --git a/docs/source/conf.py b/docs/source/conf.py
new file mode 100644
index 0000000..2284814
--- /dev/null
+++ b/docs/source/conf.py
@@ -0,0 +1,97 @@
+# 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("..", "..", "Cargo.toml")
+with open(PYPROJECT, "r", encoding="utf8") as f:
+ pyproject = f.read()
+ DATA = tomllib.loads(pyproject)
+PROJECT_VERSION = DATA["package"]["version"]
+PROJECT_NAME = DATA["package"]["name"]
+AUTHOR_TABLE = DATA["package"]["authors"]
+AUTHORS = ",".join([f"{aut}" for aut in AUTHOR_TABLE])
+
+# -- Project information -----------------------------------------------------
+# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
+
+project = "HydroRoll" # PROJECT_NAME
+release = PROJECT_VERSION # "latest"
+copyright = "2023-PRESENT, HydroRoll-Team."
+author = AUTHORS # "Hsiang Nianian"
+
+# html_title = "HydroRoll Docs"
+
+# -- 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/HydroRoll/%s", "issue %s"),
+ "doc": ("https://docs.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/HydroRoll@main/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/HydroRoll/",
+ "source_branch": "main",
+ "source_directory": "docs/source/",
+ "footer_icons": [
+ {
+ "name": "GitHub",
+ "url": "https://github.com/HydroRoll-Team/HydroRoll/",
+ "html": "",
+ "class": "fa-brands fa-github",
+ },
+ {
+ "name": "Pypi",
+ "url": "https://pypi.org/project/hydro_roll/",
+ "html": "",
+ "class": "fa-brands fa-python",
+ },
+ ],
+}
diff --git a/docs/source/index.rst b/docs/source/index.rst
new file mode 100644
index 0000000..b6bd37e
--- /dev/null
+++ b/docs/source/index.rst
@@ -0,0 +1,40 @@
+---
+hide-toc: true
+---
+
+.. include:: ../../README.rst
+ :start-after: start-index
+ :end-before: end-index
+
+
+.. .. toctree::
+.. :hidden:
+.. :caption: 用户手册
+
+.. 第一步
+.. 使用脚手架
+.. 更多的配置
+.. webui 基础
+.. NIVIS 基本语法
+.. OneRoll 语法概览
+.. webui 进阶
+.. 最佳实践
+
+.. .. toctree::
+.. :hidden:
+.. :caption: 开发手册
+
+.. 成为脚本插件作者
+.. 成为规则包作者
+.. 成为模型作者
+
+.. API 文档
+.. 开发建议
+
+.. .. toctree::
+.. :hidden:
+.. :caption: Thanks and Credits
+
+.. 社区贡献指南
+.. 变更日志
+.. 协议 \ 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 0000000..704f2ae
--- /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 0000000..084db94
--- /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 0000000..bdc8ef6
--- /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 0000000..c5055ff
--- /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 0000000..5b7742c
--- /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 0000000..184a0b0
--- /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 0000000..fa99039
--- /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 0000000..e0abeb4
--- /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 0000000..29d5832
--- /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 0000000..8aa7635
--- /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 0000000..33ec78f
--- /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 0000000..19401f4
--- /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 0000000..8719967
--- /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 0000000..512aa45
--- /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 0000000..dbc0cd2
--- /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 0000000..cb13429
--- /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 0000000..d56fffd
--- /dev/null
+++ b/docs/source/pages/grps-1/index.md
@@ -0,0 +1 @@
+# 通用规则包标准 \ No newline at end of file