Skip to content

Commit

Permalink
增加仓库地址和下载静态资源 (#8)
Browse files Browse the repository at this point in the history
* 增加仓库地址和下载静态资源

* 修复搜索弹不出来,右侧目录无法滑动的bug

---------

Co-authored-by: zhengshanshan <[email protected]>
  • Loading branch information
shan187 and zhengshanshan authored May 29, 2024
1 parent 501c611 commit 3b4e8e3
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 297 deletions.
21 changes: 18 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 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
SPHINXMULTIVERSION ?= sphinx-multiversion
SOURCEDIR = source
BUILDDIR = build
WEB_DOCS_BUILDER_URL ?= https://ai.b-bug.org/~zhengshanshan/web-docs-builder

# Put it first so that "make" without argument is like "make help".
help:
Expand All @@ -19,8 +19,23 @@ help:

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
%: Makefile $(SOURCEDIR)/_templates/versionsFlex.html $(SOURCEDIR)/_static/topbar.css $(SOURCEDIR)/_static/custom-theme.css $(SOURCEDIR)/_static/init_mermaid.js
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

mhtml:
mhtml: Makefile $(SOURCEDIR)/_templates/versionsFlex.html $(SOURCEDIR)/_static/topbar.css $(SOURCEDIR)/_static/custom-theme.css $(SOURCEDIR)/_static/init_mermaid.js
@$(SPHINXMULTIVERSION) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

_templates:
mkdir -p $(SOURCEDIR)/_templates

$(SOURCEDIR)/_templates/versionsFlex.html:
wget $(WEB_DOCS_BUILDER_URL)/_templates/$(@F) -O $@

$(SOURCEDIR)/_static/topbar.css:
wget $(WEB_DOCS_BUILDER_URL)/_static/$(@F) -O $@

$(SOURCEDIR)/_static/custom-theme.css:
wget $(WEB_DOCS_BUILDER_URL)/_static/$(@F) -O $@

$(SOURCEDIR)/_static/init_mermaid.js:
wget $(WEB_DOCS_BUILDER_URL)/_static/$(@F) -O $@
177 changes: 0 additions & 177 deletions docs/source/_static/topbar.css

This file was deleted.

26 changes: 0 additions & 26 deletions docs/source/_templates/_layout.html

This file was deleted.

70 changes: 0 additions & 70 deletions docs/source/_templates/layout.html

This file was deleted.

38 changes: 17 additions & 21 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import sys, os
import sphinx_rtd_theme

sys.path.append(os.path.abspath('exts'))

Expand All @@ -20,11 +19,19 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx_rtd_dark_mode',
'sphinx_copybutton',
'sphinx_multiversion'
'sphinx_copybutton',
'myst_parser',
'sphinx_multiversion',
'sphinxcontrib.mermaid'
]

html_js_files = [
'https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.13.8/mermaid.min.js',
'init_mermaid.js',
]
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}
templates_path = ['_templates']
exclude_patterns = []

Expand All @@ -43,32 +50,21 @@

# html_show_sphinx = False

# html_theme = 'alabaster'
html_theme = "sphinx_rtd_theme"
html_theme = "sphinx_book_theme"
html_static_path = ['_static']

# if want to add top nav for canann, enable this.
html_css_files = ['topbar.css']
html_css_files = ['topbar.css', 'custom-theme.css']

default_dark_mode = True

smv_tag_whitelist = r'^\d+\.\d+$'

html_theme_options = {
# 'analytics_id': 'G-XXXXXXXXXX', # Provided by Google in your dashboard
# 'analytics_anonymize_ip': False,
# 'logo_only': False,
'display_version': True,
'prev_next_buttons_location': 'bottom',
'style_external_links': False,
'vcs_pageview_mode': '',
# 'style_nav_header_background': '#2980B9',
# Toc options
"repository_url": "https://github.com/kendryte/arduino-k210",
'collapse_navigation': True,
'sticky_navigation': True,
'navigation_depth': 7,
'includehidden': True,
'titles_only': False
"use_edit_page_button": True,
"primary_sidebar_end": ["versionsFlex.html"],
}

# Style
Expand Down

0 comments on commit 3b4e8e3

Please sign in to comment.