Skip to content

Commit

Permalink
k230 canmv docs release v0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed Jul 8, 2024
1 parent 0127f40 commit 90dca11
Show file tree
Hide file tree
Showing 97 changed files with 11,916 additions and 19,656 deletions.
11 changes: 9 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ markdownlint:
- git config --global --add safe.directory $CI_PROJECT_DIR

.sync_github_gitee:
stage: build
timeout: 45m
image: ai.b-bug.org:5000/k230_sdk:latest
tags:
Expand Down Expand Up @@ -151,14 +152,20 @@ build web docs:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_BRANCH == "main")
image: ai.b-bug.org:5000/python:web-docs-v2
image: ai.b-bug.org:5000/huangziyi/web-docs-builder:3d9c3f0b2be1fe67b3b2f4e5d47504f6c2662b76
tags:
- k230
environment:
name: dev
url: https://ai.b-bug.org/k230/k230_canmv_docs/dev/
script:
- git fetch
- git fetch --tags
- git branch main origin/main
- git checkout main
- python3 preprocess.py
- git config --global user.email "[email protected]"
- git config --global user.name "GitLab CI"
- git commit "*.md" -m "remove cover"
- git checkout dev
- git reset --hard origin/dev
- python3 preprocess.py
Expand Down
3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
// MD033
"no-inline-html": {
"allowed_elements": [
"div"
"div",
"br"
]
},
// MD035
Expand Down
25 changes: 17 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ SPHINXBUILD ?= sphinx-build
SPHINXMULTIVERSION ?= sphinx-multiversion
SOURCEDIR = .
BUILDDIR = _build
WEB_DOCS_BUILDER_USER ?= gitlab+deploy-token-8
WEB_DOCS_BUILDER_TOKEN ?= _qsc99tPFsbcBhSbXH4S
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,13 +18,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 _templates/layout.html
%: Makefile _static/init_mermaid.js _templates/versionsFlex.html _static/topbar.css _static/custom-theme.css
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

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

_templates/layout.html:
git clone --depth 1 https://$(WEB_DOCS_BUILDER_USER):$(WEB_DOCS_BUILDER_TOKEN)@g.a-bug.org/huangziyi/web-docs-builder.git
cp web-docs-builder/layout.html _templates/layout.html
rm -rf web-docs-builder
_templates:
mkdir $@

_static/init_mermaid.js: _templates
wget $(WEB_DOCS_BUILDER_URL)/$@ -O $@

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

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

_static/custom-theme.css:
wget $(WEB_DOCS_BUILDER_URL)/$@ -O $@
177 changes: 0 additions & 177 deletions _static/topbar.css

This file was deleted.

41 changes: 0 additions & 41 deletions _templates/versions.html

This file was deleted.

35 changes: 16 additions & 19 deletions 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
import datetime

sys.path.append(os.path.abspath('exts'))
Expand All @@ -24,9 +23,17 @@
extensions = [
'sphinx_copybutton',
'myst_parser',
'sphinx_rtd_dark_mode',
'sphinx_multiversion'
'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 @@ -36,7 +43,7 @@
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

myst_heading_anchors = 4
myst_heading_anchors = 6
suppress_warnings = ["myst.header"]

html_copy_source = True
Expand All @@ -47,29 +54,19 @@
# 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

locale_dirs = ['locale']

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
'collapse_navigation': True,
'sticky_navigation': True,
"repository_url": "https://github.com/kendryte/k230_canmv_docs",
'navigation_depth': 7,
'includehidden': True,
'titles_only': False
"use_repository_button": True,
"primary_sidebar_end": ["versionsFlex.html"],
}
4 changes: 2 additions & 2 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Welcome to K230 CanMV's documentation!

.. toctree::
:maxdepth: 2

zh/CanMV-K230快速入门指南.md
zh/userguide/userguide.rst
zh/example/example.rst
zh/api/api.rst
zh/CanMV-K230常见问题解答_MicroPython.md
zh/CanMV-K230版本说明.md
zh/CanMV-K230_SDK_nncase版本对应关系.md
zh/CanMV-K230_SDK_nncase.md
Loading

0 comments on commit 90dca11

Please sign in to comment.