test more!

This commit is contained in:
shenjack 2023-07-14 00:20:10 +08:00
parent 259440290a
commit 50461e3a46
Signed by: shenjack
GPG Key ID: 7B1134A979775551
5 changed files with 39 additions and 5 deletions

2
docs/.gitignore vendored
View File

@ -3,3 +3,5 @@ index.html
book
#theme
README-en.html

View File

@ -41,6 +41,9 @@ page-break = true # insert page-break after each chapter
[rust]
edition = "2021" # the default edition for code blocks
# 从本地运行一些东西拿到 markdown 里来
[preprocessor.cmdrun]
### 扩展部分
# 检查文档内链接
@ -55,12 +58,10 @@ edition = "2021" # the default edition for code blocks
# 添加右侧目录
[preprocessor.theme]
turn-off = true
pagetoc = true
pagetoc-width = "13%"
sidebar-width = "300px"
# 从本地运行一些东西拿到 markdown 里来
[preprocessor.cmdrun]
# 在新页面中打开链接
[preprocessor.external-links]

View File

@ -18,3 +18,5 @@
- `python -m pip install -r requre`
3. 使用 `build_rs.ps1` 尝试编译一次 `DR_rs`
- `./build_rs.ps1` 38/39/310/311
<!-- cmdrun test.ps1 -->

8
docs/src/test.ps1 Normal file
View File

@ -0,0 +1,8 @@
# ls 之后将每一行输出包裹在 ` 里面
echo "``````"
Get-ChildItem . | ForEach-Object {
echo $_
}
echo "``````"

25
docs/theme/index.hbs vendored
View File

@ -110,12 +110,34 @@
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav>
<!-- Track and set sidebar scroll position -->
<script>
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
sidebarScrollbox.addEventListener('click', function(e) {
if (e.target.tagName === 'A') {
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
}
}, { passive: true });
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
sessionStorage.removeItem('sidebar-scroll');
if (sidebarScrollTop) {
// preserve sidebar scroll position when navigating via links within sidebar
sidebarScrollbox.scrollTop = sidebarScrollTop;
} else {
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
var activeSection = document.querySelector('#sidebar .active');
if (activeSection) {
activeSection.scrollIntoView({ block: 'center' });
}
}
</script>
<div id="page-wrapper" class="page-wrapper">
<div class="page">
{{> header}}
<div id="menu-bar-hover-placeholder"></div>
<div id="menu-bar" class="menu-bar sticky bordered">
<div id="menu-bar" class="menu-bar sticky">
<div class="left-buttons">
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<i class="fa fa-bars"></i>
@ -183,7 +205,6 @@
<div id="content" class="content">
<main>
<!-- Page table of contents -->
<div class="sidetoc"><nav class="pagetoc"></nav></div>
{{{ content }}}