Skip to content

Commit ddbf414

Browse files
author
yinghuochong-coder
committed
日常提交
1 parent b2cd3f3 commit ddbf414

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+5212
-5
lines changed

book_template/src/SUMMARY.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
<!-- Generated by mdbook-autosummary v0.1.9 - do not edit manually! -->
22

3-
[](<index.md>)
4-
- [mdbook 测试](<测试/index.md>)
5-
- [mdbook 测试](<测试/测试1/index.md>)
6-
- [mdbook 测试](<测试/测试1/测试2/index.md>)
7-
- [高等数学](<高等数学/index.md>)
3+
[linux 内核学习](<>)
4+
- [测试](<>)
5+
- [测试1](<>)
6+
- [代码](<测试/测试1/code.md>)
7+
- [测试2](<>)
8+
- [测试3](<>)
9+
- [测试4](<>)
10+
- [测试5](<>)
11+
- [测试6](<>)
12+
- [内容](<测试/测试1/测试2/测试3/测试4/测试5/测试6/内容.md>)
13+
- [高等数学](<>)
814
- [映射与函数.md](<高等数学/映射与函数.md>)
915
- [泰勒公式](<高等数学/泰勒公式.md>)
1016
- [洛必达法则](<高等数学/洛必达法则.md>)

book_template/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# linux 内核学习

book_template/theme/toc.js.hbs

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// Populate the sidebar
2+
//
3+
// This is a script, and not included directly in the page, to control the total size of the book.
4+
// The TOC contains an entry for each page, so if each page includes a copy of the TOC,
5+
// the total size of the page becomes O(n**2).
6+
class MDBookSidebarScrollbox extends HTMLElement {
7+
constructor() {
8+
super();
9+
}
10+
connectedCallback() {
11+
this.innerHTML = '{{#toc}}{{/toc}}';
12+
// Set the current, active page, and reveal it if it's hidden
13+
let current_page = document.location.href.toString().split("#")[0].split("?")[0];
14+
if (current_page.endsWith("/")) {
15+
current_page += "index.html";
16+
}
17+
var links = Array.prototype.slice.call(this.querySelectorAll("a"));
18+
var l = links.length;
19+
for (var i = 0; i < l; ++i) {
20+
var link = links[i];
21+
var href = link.getAttribute("href");
22+
if (href && !href.startsWith("#") && !/^(?:[a-z+]+:)?\/\//.test(href)) {
23+
link.href = path_to_root + href;
24+
}
25+
// The "index" page is supposed to alias the first chapter in the book.
26+
if (link.href === current_page || (i === 0 && path_to_root === "" && current_page.endsWith("/index.html"))) {
27+
link.classList.add("active");
28+
29+
var parent = link.parentElement;
30+
if (parent && parent.classList.contains("chapter-item")) {
31+
parent.classList.add("expanded");
32+
}
33+
while (parent) {
34+
if (parent.tagName === "LI" && parent.previousElementSibling) {
35+
if (parent.previousElementSibling.classList.contains("chapter-item")) {
36+
parent.previousElementSibling.classList.add("expanded");
37+
}
38+
}
39+
parent = parent.parentElement;
40+
}
41+
}
42+
}
43+
// Track and set sidebar scroll position
44+
this.addEventListener('click', function(e) {
45+
if (e.target.tagName === 'A') {
46+
sessionStorage.setItem('sidebar-scroll', this.scrollTop);
47+
}
48+
}, { passive: true });
49+
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
50+
sessionStorage.removeItem('sidebar-scroll');
51+
if (sidebarScrollTop) {
52+
// preserve sidebar scroll position when navigating via links within sidebar
53+
this.scrollTop = sidebarScrollTop;
54+
} else {
55+
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
56+
var activeSection = document.querySelector('#sidebar .active');
57+
if (activeSection) {
58+
activeSection.scrollIntoView({ block: 'center' });
59+
}
60+
}
61+
// Toggle buttons cxl
62+
var sidebarAnchorToggles = document.querySelectorAll('#sidebar a.toggle');
63+
function toggleSection(ev) {
64+
ev.currentTarget.parentElement.classList.toggle('expanded');
65+
if(ev.currentTarget.parentElement.childNodes.length > 1) {
66+
ev.preventDefault();
67+
}
68+
}
69+
Array.from(sidebarAnchorToggles).forEach(function (el) {
70+
el.addEventListener('click', toggleSection);
71+
});
72+
}
73+
}
74+
window.customElements.define("mdbook-sidebar-scrollbox", MDBookSidebarScrollbox);

linux_kernel/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
book

linux_kernel/book.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[book]
2+
authors = ["chenxiaolong"]
3+
language = "zh-cn"
4+
src = "src"
5+
title = "linux 内核学习"
6+
7+
[output.html]
8+
additional-css = ["./theme/css/catppuccin.css", "./theme/css/custom.css"]
9+
default-theme = "latte"
10+
preferred-dark-theme = "latte"
11+
12+
[output.html.fold]
13+
enable = true
14+
level = 10
15+
16+
# mdbook-autosummary
17+
[preprocessor.autosummary]
18+
index-name = "index.md"
19+
ignore-hidden = true
20+
21+
# This is so that mdBook doesn't start regenerating
22+
# deleted folders before autosummary can remove them from SUMMARY.md
23+
[build]
24+
create-missing = false
25+
26+
[preprocessor.katex]
27+
after = ["autosummary", "links"]

linux_kernel/src/SUMMARY.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!-- Generated by mdbook-autosummary v0.1.9 - do not edit manually! -->
2+
3+
[linux 内核学习](<>)
4+
- [测试](<>)
5+
- [测试1](<>)
6+
- [代码](<测试/测试1/code.md>)
7+
- [测试2](<>)
8+
- [测试3](<>)
9+
- [测试4](<>)
10+
- [测试5](<>)
11+
- [测试6](<>)
12+
- [内容](<测试/测试1/测试2/测试3/测试4/测试5/测试6/内容.md>)
13+
- [高等数学](<>)
14+
- [映射与函数.md](<高等数学/映射与函数.md>)
15+
- [泰勒公式](<高等数学/泰勒公式.md>)
16+
- [洛必达法则](<高等数学/洛必达法则.md>)

linux_kernel/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# linux 内核学习
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# 代码
2+
3+
### 测试
4+
> 引言
5+
6+
### 代码显示格式
7+
8+
```css
9+
10+
/* 用户消息 */
11+
.user-block {
12+
background-color: #e6f3ff;
13+
border-radius: 1rem;
14+
padding: 0.8rem 1rem;
15+
margin: 1rem 0;
16+
max-width: 80%;
17+
align-self: flex-start;
18+
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
19+
}
20+
21+
/* ChatGPT 回复 */
22+
.assistant-block {
23+
background-color: #f7f7f8;
24+
border-radius: 1rem;
25+
padding: 0.8rem 1rem;
26+
margin: 1rem 0;
27+
max-width: 80%;
28+
align-self: flex-end;
29+
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
30+
}
31+
32+
/* 父容器让对话居中显示 */
33+
.chat-container {
34+
display: flex;
35+
flex-direction: column;
36+
align-items: flex-start;
37+
}
38+
39+
40+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# 内容

0 commit comments

Comments
 (0)