From 49580e89b627e9b2271801f0a777764f7401c9e6 Mon Sep 17 00:00:00 2001 From: fanchengyan Date: Wed, 1 May 2024 23:59:18 +0800 Subject: [PATCH] update docs --- .readthedocs.yaml | 2 +- docs/requirements.txt | 11 ++++---- docs/source/conf.py | 59 ++++++++++++++++++++++++++++++++++--------- 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b8a7a50..28e6899 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.9" + python: "3.11" # You can also specify other tool versions: # nodejs: "19" # rust: "1.64" diff --git a/docs/requirements.txt b/docs/requirements.txt index c886ee9..1b7771f 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,7 @@ recommonmark -sphinx -myst-parser -sphinxcontrib-video -sphinx_rtd_theme -Jinja2 +sphinx>=7 +myst-nb +sphinx-copybutton +sphinx-design +pydata_sphinx_theme +Jinja2 \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index d3dcd53..471b861 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -7,7 +7,7 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = 'Geo-SAM' -copyright = '2023, Joey, Fancy' +copyright = '2023-2024, Joey, Fancy' author = 'Joey, Fancy' release = 'v1.2' @@ -15,27 +15,62 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ - 'myst_parser', - 'sphinx.ext.autodoc', - 'sphinxcontrib.video', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.napoleon', - 'sphinx.ext.todo', + # "myst_nb", + "myst_parser", + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx_copybutton", + "sphinx_design", ] source_suffix = { - '.rst': 'restructuredtext', - '.md': 'markdown', + ".rst": "restructuredtext", + ".md": "markdown", } +myst_enable_extensions = ["colon_fence"] +myst_url_schemes = ["http", "https", "mailto"] +suppress_warnings = ["mystnb.unknown_mime_type"] +nb_execution_mode = "off" +autodoc_inherit_docstrings = True # templates_path = ['_templates'] exclude_patterns = [] - # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = 'sphinx_rtd_theme' +html_theme = 'pydata_sphinx_theme' html_static_path = ['_static'] +html_context = { + "github_url": "https://github.com", # or your GitHub Enterprise site + "github_user": "coolzhao", + "github_repo": "Geo-SAM", + "github_version": "main", + "doc_path": "docs/source", +} + + +html_theme_options = { + "show_toc_level": 2, + "show_nav_level": 2, + "use_edit_page_button": True, + "icon_links": [ + { + "name": "GitHub", + "url": "https://github.com/coolzhao/Geo-SAM", + "icon": "fa-brands fa-square-github", + "type": "fontawesome", + }, + { + "name": "PyPI", + "url": "https://pypi.org/project/GeoSAM-Image-Encoder", + "icon": "fa-brands fa-python", + "type": "fontawesome", + }, + ], +} + video_enforce_extra_source = True