mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-04 20:17:47 +08:00
add Chinese Document
This commit is contained in:
+9
-8
@@ -91,9 +91,9 @@ 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/images']
|
||||
html_static_path = ['source/_static','source/image']
|
||||
|
||||
html_extra_path = ['source/images']
|
||||
html_extra_path = ['source/image']
|
||||
|
||||
html_theme_options = {
|
||||
# 'analytics_id': 'G-EVD5Z6G6NH',
|
||||
@@ -192,9 +192,10 @@ def copy_videos(app, exception):
|
||||
shutil.copytree(src_dir, dest_dir)
|
||||
|
||||
# 20201030
|
||||
def setup(app):
|
||||
app.add_config_value('recommonmark_config', {
|
||||
'url_resolver': lambda url: github_doc_root + url,
|
||||
'auto_toc_tree_section': 'Contents',
|
||||
}, True)
|
||||
app.add_transform(AutoStructify)
|
||||
# github_doc_root = 'https://github.com/yourusername/yourrepo/blob/main/'
|
||||
# def setup(app):
|
||||
# app.add_config_value('recommonmark_config', {
|
||||
# 'url_resolver': lambda url: github_doc_root + url,
|
||||
# 'auto_toc_tree_section': 'Contents',
|
||||
# }, True)
|
||||
# app.add_transform(AutoStructify)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Language switch for English version
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Create language switch link
|
||||
var langSwitch = document.createElement('div');
|
||||
langSwitch.className = 'language-switch';
|
||||
langSwitch.innerHTML = '<a href="/OrbbecSDK_ROS2/zh/" title="切换到中文">中文</a>';
|
||||
|
||||
// Add styles
|
||||
var style = document.createElement('style');
|
||||
style.textContent = `
|
||||
.language-switch {
|
||||
position: fixed;
|
||||
top: 10px;
|
||||
right: 60px;
|
||||
z-index: 1000;
|
||||
}
|
||||
.language-switch a {
|
||||
color: #fff;
|
||||
background: #2980b9;
|
||||
padding: 5px 15px;
|
||||
border-radius: 3px;
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
transition: background 0.3s;
|
||||
}
|
||||
.language-switch a:hover {
|
||||
background: #3498db;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
.language-switch {
|
||||
top: 5px;
|
||||
right: 10px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
document.head.appendChild(style);
|
||||
document.body.appendChild(langSwitch);
|
||||
});
|
||||
Reference in New Issue
Block a user