docs: scaffold zh-CN mdbook

This commit is contained in:
Christian Visintin
2026-06-08 09:04:06 +02:00
parent ee69ba6ef8
commit aed4ecc522
26 changed files with 2787 additions and 0 deletions

37
docs/zh-CN/SUMMARY.md Normal file
View File

@@ -0,0 +1,37 @@
# 目录
[简介](index.md)
# 入门
- [安装](getting-started/installation.md)
- [连接到服务器](getting-started/connecting.md)
- [连接参数](getting-started/connection-parameters.md)
# 使用 termscp
- [文件浏览器](usage/file-explorer.md)
- [键盘快捷键](usage/keyboard-shortcuts.md)
- [批量操作文件](usage/multiple-files.md)
- [同步浏览](usage/synced-browsing.md)
- [打开与编辑文件](usage/open-edit-files.md)
- [书签与最近主机](usage/bookmarks.md)
- [保持文件同步](usage/file-watcher.md)
# 配置
- [配置](configuration/configuration.md)
- [文件浏览器格式](configuration/explorer-format.md)
- [SSH 密钥存储](configuration/ssh-keys.md)
- [主题](configuration/themes.md)
- [通知](configuration/notifications.md)
- [日志](configuration/logging.md)
- [密码安全](configuration/password-security.md)
# 命令行参考
- [命令行用法](cli/cli.md)
# 开发者
- [开发者手册](developer/developer.md)

22
docs/zh-CN/book.toml Normal file
View File

@@ -0,0 +1,22 @@
[book]
title = "termscp"
description = "A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/Kube/S3/SMB/WebDAV"
authors = ["Christian Visintin"]
language = "zh"
src = "."
[output.html]
default-theme = "light"
preferred-dark-theme = "navy"
git-repository-url = "https://github.com/veeso/termscp"
edit-url-template = "https://github.com/veeso/termscp/edit/main/docs/zh-CN/{path}"
additional-js = ["lang-switcher.js", "mermaid.min.js", "mermaid-init.js"]
[output.html.fold]
enable = true
level = 1
[preprocessor]
[preprocessor.mermaid]
command = "mdbook-mermaid"

1
docs/zh-CN/cli/cli.md Normal file
View File

@@ -0,0 +1 @@
# 命令行用法

View File

@@ -0,0 +1 @@
# 配置

View File

@@ -0,0 +1 @@
# 文件浏览器格式

View File

@@ -0,0 +1 @@
# 日志

View File

@@ -0,0 +1 @@
# 通知

View File

@@ -0,0 +1 @@
# 密码安全

View File

@@ -0,0 +1 @@
# SSH 密钥存储

View File

@@ -0,0 +1 @@
# 主题

View File

@@ -0,0 +1 @@
# 开发者手册

View File

@@ -0,0 +1 @@
# 连接到服务器

View File

@@ -0,0 +1 @@
# 连接参数

View File

@@ -0,0 +1 @@
# 安装

1
docs/zh-CN/index.md Normal file
View File

@@ -0,0 +1 @@
# termscp

View File

@@ -0,0 +1,47 @@
// Injects a language toggle (EN / 中文) into the mdBook menu bar.
// Swaps the leading /en-US/ <-> /zh-CN/ path segment, preserving the
// rest of the path; falls back to the language root on 404 navigation.
(function () {
const LANGS = [
{ code: "en-US", label: "EN" },
{ code: "zh-CN", label: "中文" },
];
function currentLang() {
const m = window.location.pathname.match(/\/(en-US|zh-CN)\//);
return m ? m[1] : "en-US";
}
function swapTo(code) {
const path = window.location.pathname;
const cur = currentLang();
if (path.includes(`/${cur}/`)) {
return path.replace(`/${cur}/`, `/${code}/`);
}
return `/${code}/`;
}
function build() {
const right = document.querySelector(".right-buttons");
if (!right) return;
const cur = currentLang();
const wrap = document.createElement("div");
wrap.className = "lang-switcher";
wrap.style.display = "inline-flex";
wrap.style.gap = "0.5rem";
wrap.style.marginInlineStart = "0.5rem";
LANGS.forEach((l) => {
const a = document.createElement("a");
a.textContent = l.label;
a.href = swapTo(l.code);
a.title = l.code;
a.setAttribute("aria-current", l.code === cur ? "true" : "false");
if (l.code === cur) a.style.fontWeight = "bold";
wrap.appendChild(a);
});
right.appendChild(wrap);
}
if (document.readyState !== "loading") build();
else document.addEventListener("DOMContentLoaded", build);
})();

View File

@@ -0,0 +1,39 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
(() => {
const darkThemes = ['ayu', 'navy', 'coal'];
const lightThemes = ['light', 'rust'];
const classList = document.getElementsByTagName('html')[0].classList;
let lastThemeWasLight = true;
for (const cssClass of classList) {
if (darkThemes.includes(cssClass)) {
lastThemeWasLight = false;
break;
}
}
const theme = lastThemeWasLight ? 'default' : 'dark';
mermaid.initialize({ startOnLoad: true, theme });
// Simplest way to make mermaid re-render the diagrams in the new theme is via refreshing the page
for (const darkTheme of darkThemes) {
document.getElementById(darkTheme).addEventListener('click', () => {
if (lastThemeWasLight) {
window.location.reload();
}
});
}
for (const lightTheme of lightThemes) {
document.getElementById(lightTheme).addEventListener('click', () => {
if (!lastThemeWasLight) {
window.location.reload();
}
});
}
})();

2609
docs/zh-CN/mermaid.min.js vendored Normal file

File diff suppressed because one or more lines are too long

13
docs/zh-CN/theme/head.hbs Normal file
View File

@@ -0,0 +1,13 @@
<link rel="icon" type="image/x-icon" href="/shared/favicon.ico">
<link rel="icon" type="image/svg+xml" href="/shared/termscp.svg">
<meta property="og:title" content="{{#if chapter_title}}{{ chapter_title }} · {{/if}}{{ book_title }}">
<meta property="og:description" content="A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/Kube/S3/SMB/WebDAV">
<meta property="og:image" content="https://docs.termscp.rs/og_preview.jpg">
<meta property="og:url" content="https://docs.termscp.rs/">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{#if chapter_title}}{{ chapter_title }} · {{/if}}{{ book_title }}">
<meta name="twitter:description" content="A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/Kube/S3/SMB/WebDAV">
<meta name="twitter:image" content="https://docs.termscp.rs/og_preview.jpg">

View File

@@ -0,0 +1 @@
# 书签与最近主机

View File

@@ -0,0 +1 @@
# 文件浏览器

View File

@@ -0,0 +1 @@
# 保持文件同步

View File

@@ -0,0 +1 @@
# 键盘快捷键

View File

@@ -0,0 +1 @@
# 批量操作文件

View File

@@ -0,0 +1 @@
# 打开与编辑文件

View File

@@ -0,0 +1 @@
# 同步浏览