From 88cbd9883914aa54251dd758902378f7503febf8 Mon Sep 17 00:00:00 2001 From: sumitS Date: Mon, 17 Jul 2023 17:31:11 +0545 Subject: [PATCH] refactor: sphinx template docs to mkdocs material --- docs/conf.py | 61 ++++++++++++++++++++++++++++++++++++++++--- requirements/docs.in | 1 + requirements/docs.txt | 1 + 3 files changed, 60 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 771a7228..dab838ce 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,9 +16,10 @@ extensions = [ "sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinxcontrib.log_cabinet", - "pallets_sphinx_themes", + # "pallets_sphinx_themes", "sphinx_issues", "sphinx_tabs.tabs", + "sphinx_immaterial" ] autodoc_typehints = "description" intersphinx_mapping = { @@ -35,8 +36,62 @@ issues_github_path = "pallets/flask" # HTML ----------------------------------------------------------------- -html_theme = "flask" -html_theme_options = {"index_sidebar_logo": False} +html_theme = "sphinx_immaterial" +html_theme_options = { + # "index_sidebar_logo": False, + "features": [ + "navigation.expand", + # "navigation.tabs", + # "toc.integrate", + "navigation.sections", + # "navigation.instant", + # "header.autohide", + "navigation.top", + # "navigation.tracking", + # "search.highlight", + "search.share", + "toc.follow", + "toc.sticky", + "content.tabs.link", + "announce.dismiss", + ], + "palette": [ + { + "media": "(prefers-color-scheme: light)", + "scheme": "default", + "primary": "blue-grey", + "accent": "blue", + "toggle": { + "icon": "material/lightbulb-outline", + "name": "Switch to dark mode", + }, + }, + { + "media": "(prefers-color-scheme: dark)", + "scheme": "slate", + "primary": "blue-grey", + "accent": "blue", + "toggle": { + "icon": "material/lightbulb", + "name": "Switch to light mode", + }, + }, + ], + "toc_title_is_page_title": True, + # BEGIN: social icons + "social": [ + { + "icon": "fontawesome/brands/github", + "link": "https://github.com/singh-sumit/flask/", + "name": "Source on github.com", + }, + { + "icon": "fontawesome/brands/python", + "link": "https://pypi.org/project/Flask/", + }, + ], + # END: social icons +} html_context = { "project_links": [ ProjectLink("Donate", "https://palletsprojects.com/donate"), diff --git a/requirements/docs.in b/requirements/docs.in index 3ee050af..5796f3c8 100644 --- a/requirements/docs.in +++ b/requirements/docs.in @@ -3,3 +3,4 @@ Sphinx sphinx-issues sphinxcontrib-log-cabinet sphinx-tabs +sphinx-immaterial \ No newline at end of file diff --git a/requirements/docs.txt b/requirements/docs.txt index 26922dd7..8bef7171 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -66,3 +66,4 @@ sphinxcontrib-serializinghtml==1.1.5 # via sphinx urllib3==2.0.3 # via requests +sphinx-immaterial==0.11.5