Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI #7

Merged
merged 10 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
alabaster==0.7.13
Babel==2.12.1
certifi==2023.7.22
charset-normalizer==3.2.0
docutils==0.18.1
idna==3.4
imagesize==1.4.1
importlib-metadata==6.8.0
Jinja2==3.1.2
markdown-it-py==2.2.0
MarkupSafe==2.1.3
mdit-py-plugins==0.3.5
mdurl==0.1.2
myst-parser==1.0.0
packaging==23.1
Pygments==2.16.1
PyYAML==6.0.1
requests==2.31.0
snowballstemmer==2.2.0
sphinx==5.3.0
sphinx-copybutton==0.5.2
sphinx-multiversion==0.2.4
sphinx-rtd-theme==1.3.0
sphinxcontrib-applehelp==1.0.7
sphinxcontrib-devhelp==1.0.5
sphinxcontrib-htmlhelp==2.0.4
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.6
sphinxcontrib-serializinghtml==1.1.9
urllib3==2.0.5
zipp==3.17.0
9 changes: 9 additions & 0 deletions docs/source/_static/img/ch-flag.a61145a4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/source/_static/img/logo.2f7049e2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
177 changes: 177 additions & 0 deletions docs/source/_static/topbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
/* Customize for top bar (testing and outdated docs)*/

:target {
scroll-margin-top: 50px;
}

.wy-nav-side
{
min-height: calc(100% - 50px);
top: 50px;
}

.wy-nav-content-wrap
{
margin-top: 50px !important;
}

/* The navigation bar */
nav.navbar {
z-index: 3;
overflow: hidden;
background-color: #333;
position: fixed; /* Set the navbar to fixed position */
top: 0; /* Position the navbar at the top of the page */
width: 100%; /* Full width */
}

/* Links inside the navbar */
nav.navbar a {
float: left;
display: block;
color: rgba(255,255,255,0.5);
text-align: center;
padding: 14px 16px;
text-decoration: none;
text-wrap: nowrap;
}

.jn_container-view {
width: 100%;
height: 50px;
background: #0d0d0d;
position: fixed;
left: 0;
top: 0;
z-index: 1501;
}

.jn_menu-container {
width: 100%;
max-width: 1100px;
height: 50px;
align-items: center;
margin: 0 auto;
display: flex;
position: relative
}

.jn_menu-container .logo {
width: 157px;
height: 28px;
background: url(img/logo.2f7049e2.svg) no-repeat 100%;
background-size: auto 100%;
}

.jn_menu-container .menu-list {
display: flex;
height: 100%;
font-size: 16px;
color: rgba(255,255,255,0.4);
margin-left: 78px;
max-width: 506px;
}

.menu-list .menu-item {
margin-right: 30px;
height: 100%;
cursor: pointer;
display: flex;
align-items: center;
}

@media (max-width: 768px) {
.logo {
display: none;
}

.menu-list .menu-item {
margin-right: 0;
}

.jn_menu-container .menu-list {
margin-left: 0;
justify-content: space-around;
flex-grow: 1;
}

nav.navbar a {
padding: 3px;
}
}

.jn_menu-container .menu-item.active a {
color: #fff
}

.jn_menu-container .menu-item:last-child {
margin-right: 0
}

.jn_menu-container .active,
.jn_menu-container .menu-item a:hover {
color: #fff
}

.jn_menu-container .menu-lang {
position: absolute;
right: 0;
top: 50%;
font-size: 14px;
color: hsla(0, 0%, 100%, .5);
transform: translateY(-50%)
}

.jn_menu-container .menu-lang .lang-txt {
height: 20px;
padding-right: 28px;
background: url(img/ch-flag.a61145a4.svg) no-repeat 100%;
background-size: auto 70%;
display: block;
cursor: pointer
}

.menu-doc a {
color: #f2f2f2 !important;
}

.model-list {
position: absolute;
top: 50px;
background: #0d0d0d;
display: none;
cursor: pointer;
flex-direction: column;
}

.menu-doc:hover > .model-list {
display: flex;
align-items: center;
}

.document-select {
padding: 10px !important;
color: #fff;
text-align: start !important;
text-wrap: wrap !important;
}

.document-select:hover {
background-color: #249ee8 !important;
}

.expanded-menu {
position: relative;
}
.expanded-menu-container {
display: none;
flex-direction: column;
position: absolute;
top: 0;
right: -120px;
width: 120px;
background-color: #0d0d0d;
}
.expanded-menu:hover .expanded-menu-container {
display: flex;
}
70 changes: 70 additions & 0 deletions docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{% extends "sphinx_rtd_theme/layout.html" %}

{%block extrabody %}
<style>
/*@import url('/topbar.css');*/
</style>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-7J9HL06P02"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-7J9HL06P02');
</script>
<script>
var _hmt = _hmt || [];
window._hmt = _hmt; // 修改为window 全局变量
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?d4832d9026d5bdd9eca72f27bb63dfb3"; //此处请替换你的站点id
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<nav class="navbar">
<div class="jn_container-view">
<div class="jn_menu-container">
<span class="logo"></span>
<ul class="menu-list">
<li class="menu-item"><a href="/resource" class="menu-router">资料下载</a></li>
<li class="menu-item menu-doc">
<a class="menu-router">文档</a>
<div class="model-list">
<div class="document-select expanded-menu">
<span>K210</span>
<div class="expanded-menu-container">
<a href="/canmv/main/canmv/index.html" class="document-select">CanMV</a>
<a href="/arduino/main/index.html" class="document-select">Arduino</a>
</div>
</div>
<div class="document-select expanded-menu">
<span>K510</span>
<div class="expanded-menu-container">
<a href="https://github.com/kendryte/k510_docs" class="document-select" target="_blank">SDK</a>
<a href="https://canaan-docs.100ask.net/Application" class="document-select" target="_blank">DongshanPI-Vision</a>
</div>
</div>
<div class="document-select expanded-menu">
<span>K230</span>
<div class="expanded-menu-container">
<a href="/k230/dev/index.html" class="document-select">SDK</a>
<a href="/k230_canmv/dev/index.html" class="document-select">CanMV</a>
<a href="/ai_docs" class="document-select">AI开发教程</a>
</div>
</div>
</div>
</li>
<li class="menu-item"><a href="/model/library" class="menu-router">模型库</a></li>
<li class="menu-item"><a href="/training" class="menu-router">模型训练</a></li>
<li class="menu-item"><a href="/home/0" class="menu-router">BBS</a></li>
<li class="menu-item"><a href="/blog" class="menu-router">Blog</a></li>
</ul>
<div class="jn_phone-menu"></div>
</div>
</div>
</nav>

{{ super() }}

{% endblock extrabody %}
33 changes: 0 additions & 33 deletions docs/source/_templates/versions.html

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
html_static_path = ['_static']

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

default_dark_mode = True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ html[data-theme='dark'] .wy-nav-content-wrap {
html[data-theme='dark'] .wy-nav-content {
/* background-color: #141414; */
background-color: #393939;
max-width: 900px;
}

html[data-theme='dark'] .section {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const createThemeSwitcher = () => {
};

$(document).ready(() => {
// createThemeSwitcher();
// $('#themeSwitcher').click(switchTheme);
createThemeSwitcher();
$('#themeSwitcher').click(switchTheme);

$('footer').html(
$('footer').html() +
Expand Down