mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-07 21:37:46 +08:00
docs: implement versioning system and enhance documentation structure
This commit is contained in:
+20
-4
@@ -24,6 +24,15 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..', '_ext'))
|
||||
|
||||
import recommonmark
|
||||
from recommonmark.transform import AutoStructify
|
||||
from versioning import (
|
||||
build_version_context,
|
||||
get_asset_path,
|
||||
get_conf_root,
|
||||
get_content_root,
|
||||
get_extra_paths,
|
||||
get_static_paths,
|
||||
get_templates_paths,
|
||||
)
|
||||
|
||||
# import sphinx_book_theme
|
||||
# import sphinx_rtd_theme
|
||||
@@ -35,6 +44,9 @@ from recommonmark.transform import AutoStructify
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
# html_theme = "furo"
|
||||
|
||||
content_root = get_content_root(__file__)
|
||||
conf_root = get_conf_root(__file__)
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'OrbbecSDK V2 ROS2 Wrapper'
|
||||
@@ -57,6 +69,7 @@ extensions = ['recommonmark',
|
||||
'sphinx_copybutton',
|
||||
'sphinx.ext.autosectionlabel',
|
||||
'language_switch',
|
||||
'version_switch',
|
||||
'section_search',
|
||||
# 'myst_parser',
|
||||
]
|
||||
@@ -67,7 +80,7 @@ source_suffix = ['.rst', 'rest', '.md', '.MD']
|
||||
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
templates_path = get_templates_paths(conf_root)
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
@@ -89,16 +102,16 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
||||
# html_favicon = "source/_static/orbbec_logo2.png"
|
||||
|
||||
#html_logo = "source/_static/orbbec-light_no_colour.svg"
|
||||
html_favicon = "source/_static/orbbec_footerlogo_3d_world.svg"
|
||||
html_favicon = get_asset_path(conf_root, "source/_static/orbbec_footerlogo_3d_world.svg", "source/_static/orbbec_footerlogo_3d_world.svg")
|
||||
# html_logo = "source/_static/orbbec_footerlogo_3d_world.svg"
|
||||
# html_favicon = "source/_static/orbbec_footerlogo_3d_world.svg"
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['source/_static','source/image']
|
||||
html_static_path = get_static_paths(conf_root, content_root)
|
||||
|
||||
html_extra_path = ['source/image']
|
||||
html_extra_path = get_extra_paths(content_root)
|
||||
|
||||
html_theme_options = {
|
||||
# 'analytics_id': 'G-EVD5Z6G6NH',
|
||||
@@ -137,6 +150,9 @@ html_theme_options = {
|
||||
|
||||
# #不需要添加_static目录,加了会不起作用
|
||||
html_css_files = ["custom.css"]
|
||||
html_context = {
|
||||
"docs_versioning": build_version_context(language),
|
||||
}
|
||||
|
||||
# 与文档无关的其他资源的路径,由于无需构建此文件夹的文件,会自动忽略
|
||||
# 默认情况下,此路径下的文件会输出到生成的html的根目录
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
|
||||
.lang-switch {
|
||||
position: fixed !important;
|
||||
top: 60px !important;
|
||||
right: 20px !important;
|
||||
z-index: 1000 !important;
|
||||
position: static !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
gap: 0.45rem !important;
|
||||
margin: 0 !important;
|
||||
background: rgba(255,255,255,0.95) !important;
|
||||
border: 1px solid #ddd !important;
|
||||
border-radius: 6px !important;
|
||||
border-radius: 10px !important;
|
||||
padding: 8px 12px !important;
|
||||
font-size: 0.9em !important;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
|
||||
box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14) !important;
|
||||
backdrop-filter: blur(5px) !important;
|
||||
transition: all 0.3s ease !important;
|
||||
}
|
||||
@@ -26,7 +27,6 @@
|
||||
|
||||
.lang-switch .lang-other {
|
||||
color: #0078d4 !important;
|
||||
margin-right: 8px !important;
|
||||
}
|
||||
|
||||
.lang-switch .lang-other:hover {
|
||||
@@ -36,7 +36,6 @@
|
||||
.lang-switch .lang-current {
|
||||
color: #333 !important;
|
||||
font-weight: bold !important;
|
||||
margin-left: 8px !important;
|
||||
}
|
||||
|
||||
.wy-nav-side .wy-side-nav-search {
|
||||
@@ -121,10 +120,8 @@
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.lang-switch {
|
||||
top: 10px !important;
|
||||
right: 10px !important;
|
||||
font-size: 0.8em !important;
|
||||
padding: 6px 8px !important;
|
||||
font-size: 0.8em !important;
|
||||
padding: 6px 8px !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user