From 2525e8916570951a3aceaf9e922c8c1408ca101c Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Tue, 7 Oct 2025 03:02:45 +0800 Subject: feat: enhance documentation build process with rinoh support and update dependencies --- docs/Makefile | 5 ++++- docs/requirements.txt | 4 +++- docs/source/conf.py | 22 ++++++++++++++++++++++ docs/source/index.rst | 6 +++++- 4 files changed, 34 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/Makefile b/docs/Makefile index 59b5b2c..7110ad0 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -28,4 +28,7 @@ translate: # build for debug dev: - @$(ppm) run sphinx-autobuild source _build/html \ No newline at end of file + @$(ppm) run sphinx-autobuild source _build/html + +rinoh: + @$(ppm) run $(SPHINXBUILD) -b $(SOURCEDIR) . _build/rinoh $(O) \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index 2e616e2..6b31d2b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -5,4 +5,6 @@ myst-parser>=3.0.1 sphinx>=7.3.7 tomli>=2.0.1 sphinx-intl>=2.2.0 -sphinxcontrib-httpdomain \ No newline at end of file +sphinxcontrib-httpdomain +sphinx-click>=6.0.0 +rinohtype \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index b156ee0..72a569b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -4,6 +4,26 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html import os, sys +from pathlib import Path + +# from rinoh.frontend.rst import ReStructuredTextReader +# from rinoh.template import TemplateConfigurationFile + +# the parser builds a rinohtype document tree +# parser = ReStructuredTextReader() +# with open('index.rst') as file: +# document_tree = parser.parse(file) + +# load the article template configuration file +# script_path = Path(sys.path[0]).resolve() +# config = TemplateConfigurationFile(script_path / 'oneroll.rtt') + +# render the document to 'my_document.pdf' +# document = config.document(document_tree) +# document.render('my_document') + +# rinoh_documents = [dict(doc='index', # top-level file (index.rst) +# target='manual')] # output file (manual.pdf) if sys.version_info >= (3, 11): import tomllib @@ -55,6 +75,7 @@ extensions = [ "sphinxcontrib.httpdomain", "sphinx.ext.ifconfig", "myst_parser", + "sphinx_click", ] doctest_global_setup = """ @@ -149,3 +170,4 @@ html_theme_options = { # '**': ['globaltoc.html', 'sourcelink.html', 'searchbox.html', 'relations.html'], # 'using/windows': ['windowssidebar.html', 'searchbox.html'], # } +latex_documents = {} diff --git a/docs/source/index.rst b/docs/source/index.rst index 0a5fff9..b3610c4 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -8,4 +8,8 @@ OneRoll introduction usage api - examples \ No newline at end of file + examples + + +Indices and tables +================== \ No newline at end of file -- cgit v1.2.3-70-g09d2