From ae345a2f193a4d6022edda76523a39f6e891843e Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Sat, 24 Feb 2024 12:48:55 +0800 Subject: refactor!: rewrite python package --- docs/source/CONTRIBUTING.rst | 2 + docs/source/COPYING.rst | 1 + docs/source/changelog.rst | 3 ++ docs/source/conf.py | 99 ++++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 23 +++++++++ docs/source/pages/contributing.rst | 0 6 files changed, 128 insertions(+) create mode 100644 docs/source/CONTRIBUTING.rst create mode 100644 docs/source/COPYING.rst create mode 100644 docs/source/changelog.rst create mode 100644 docs/source/conf.py create mode 100644 docs/source/index.rst create mode 100644 docs/source/pages/contributing.rst (limited to 'docs/source') diff --git a/docs/source/CONTRIBUTING.rst b/docs/source/CONTRIBUTING.rst new file mode 100644 index 0000000..e75758c --- /dev/null +++ b/docs/source/CONTRIBUTING.rst @@ -0,0 +1,2 @@ +```{include} ../../CONTRIBUTING.md +``` \ No newline at end of file diff --git a/docs/source/COPYING.rst b/docs/source/COPYING.rst new file mode 100644 index 0000000..ea3bea4 --- /dev/null +++ b/docs/source/COPYING.rst @@ -0,0 +1 @@ +.. include:: ../../COPYING \ No newline at end of file diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst new file mode 100644 index 0000000..19a8b62 --- /dev/null +++ b/docs/source/changelog.rst @@ -0,0 +1,3 @@ +.. maxdepth: 1 + +.. 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..9890225 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,99 @@ +# 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']}" for aut in AUTHOR_TABLE]) + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = PROJECT_NAME # "Infini" +release = PROJECT_VERSION # "latest" +copyright = ( + "2023-PRESENT, HydroRoll-Team & 浊莲." +) +author = AUTHORS # "Hsiang Nianian" + +html_title = "INFINI GENERATOR II" + +# -- 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": "documentation is still under construction now, welcome any contribution!", + "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", + }, + ], +} diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..5ddf853 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,23 @@ +.. hide-toc: true + +Nivis - ❄ +========= + +.. include:: ../../README.rst + :start-after: .. index-start + :end-before: .. index-end + + +.. toctree:: + :hidden: + + Quick start + + +.. toctree:: + :caption: Development + :hidden: + + Contributing + Changelog + COPYING \ No newline at end of file diff --git a/docs/source/pages/contributing.rst b/docs/source/pages/contributing.rst new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3-70-g09d2