Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
51a1e22
chore(tooling): initialize uv project with Python 3.14
Alice39s Aug 9, 2026
20e2623
test(models): add pytest fixtures and data model coverage
Alice39s Aug 9, 2026
9a35d62
feat(frontmatter): parse page metadata and descriptions
Alice39s Aug 9, 2026
1c81af6
feat(scanner): scan documentation trees
Alice39s Aug 9, 2026
fd3fa22
feat(contributing): inject contribution notices
Alice39s Aug 9, 2026
6f6f60e
feat(docslist): render documentation cards
Alice39s Aug 9, 2026
f91917a
feat(redirects): generate client-side redirect script
Alice39s Aug 9, 2026
069a0f2
feat(nav): generate ordered navigation
Alice39s Aug 9, 2026
1799db6
feat(index): render directory index pages
Alice39s Aug 9, 2026
cb5af87
feat(generator): orchestrate documentation generation
Alice39s Aug 9, 2026
c04c40d
fix(redirects): tolerate invalid redirect configuration
Alice39s Aug 9, 2026
0dcab6c
fix(frontmatter): skip indented description content
Alice39s Aug 9, 2026
9737417
refactor(cli): centralize development and build commands
Alice39s Aug 9, 2026
5d56988
chore(ruff): configure linting and format Python sources
Alice39s Aug 9, 2026
6c4f3b8
chore(docs): format Markdown with mdformat
Alice39s Aug 9, 2026
396ef69
ci(actions): add uv, lint, test, and build checks
Alice39s Aug 9, 2026
ab6c2e7
chore(tooling): remove legacy dependency workflows
Alice39s Aug 9, 2026
8426340
fix(docs): replace broken account documentation links
Alice39s Aug 9, 2026
687cfe2
ci(actions): run checks on dev branch
Alice39s Aug 9, 2026
d4e62b3
fix(cli): keep file watcher alive after generation errors
Alice39s Aug 9, 2026
97b3ba7
fix(ci): pin setup-uv to a published release
Alice39s Aug 9, 2026
a2e7c47
fix(tooling): harden deterministic documentation builds
Alice39s Aug 9, 2026
d193652
refactor(cli): adopt Typer command routing
Alice39s Aug 9, 2026
a865062
feat(cli): integrate redirect management
Alice39s Aug 9, 2026
956f981
feat(cli): add unified quality checks
Alice39s Aug 9, 2026
2afeca5
refactor(scripts): centralize platform launchers
Alice39s Aug 9, 2026
26bdc9e
fix(cli): ignore local design files in checks
Alice39s Aug 9, 2026
b3d3828
docs(tooling): document the cross-platform CLI
Alice39s Aug 9, 2026
c88a299
ci(actions): verify launchers on all platforms
Alice39s Aug 9, 2026
34288d2
test(scripts): compare launcher roots portably
Alice39s Aug 9, 2026
5b5cfd5
fix(tooling): pin Markdown line endings
Alice39s Aug 9, 2026
27dd874
refactor(assets): centralize documentation resources
Alice39s Aug 9, 2026
4ca1e08
feat(images): add WebP images with compressed fallbacks
Alice39s Aug 9, 2026
1083585
fix(build): hide Material generator fingerprint
Alice39s Aug 9, 2026
b43c92f
feat(build): minify generated HTML
Alice39s Aug 9, 2026
141db17
docs(build): document the asset pipeline
Alice39s Aug 9, 2026
f2d2203
fix(build): preserve HTML attribute quotes
Alice39s Aug 9, 2026
25f5cbb
docs: add repository guidelines (AGENTS.md)
Alice39s Aug 9, 2026
94bb7fc
feat(ai): support llms.txt, per-page Markdown and ChatGPT/Claude open
Alice39s Aug 9, 2026
4562813
fix(ai): align AI tool buttons with Material conventions, graceful de…
Alice39s Aug 9, 2026
8d86bc8
fix(ui): restore homepage rendering and add Open menu
Alice39s Aug 9, 2026
b531e44
feat(ai): expand Open menu providers
Alice39s Aug 9, 2026
7e0f91d
chore: ignore macOS metadata files
Alice39s Aug 9, 2026
030b318
feat(ui): add provider icons to Open button
Alice39s Aug 9, 2026
3c9f2fe
feat(ai): add copy Markdown action
Alice39s Aug 9, 2026
4b99533
feat(ai): localize article prompt
Alice39s Aug 10, 2026
a7feb7a
feat(ui): use Grok brand icon and stack action buttons below 890px
Alice39s Aug 10, 2026
20d7e26
fix(ui): reword open label and place actions under title below 768px
Alice39s Aug 10, 2026
8b43167
fix(ui): unify action layout breakpoint at 768px, render home images,…
Alice39s Aug 10, 2026
c0adb7d
docs(account): restore register and two-factor auth articles
Alice39s Aug 10, 2026
1c06af9
feat(ui): hide actions on home, reword buttons, smooth scroll
Alice39s Aug 10, 2026
e20e82a
feat(serve): serve markdown as text/plain utf-8
Alice39s Aug 10, 2026
47f8efc
feat(ui): side-by-side outlined actions on mobile
Alice39s Aug 10, 2026
66abb04
fix(ui): lower actions z-index, left-align on small screens
Alice39s Aug 10, 2026
ef99f47
fix(test): write fixture with LF line endings on all platforms
Alice39s Aug 10, 2026
0d9c5a4
refactor(lifecycle): replace staging with MkDocs plugin
Alice39s Aug 10, 2026
84e2105
merge: integrate lifecycle refactor into dev
Alice39s Aug 10, 2026
1c43f50
fix(review): resolve rendering and lifecycle regressions
Alice39s Aug 11, 2026
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Keep formatter-sensitive Markdown stable across platforms.
*.md text eol=lf
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# .github/workflows/ci.yml
name: CI

on:
push:
branches: ["main", "dev"]
pull_request:

jobs:
ci:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
permissions: {}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
enable-cache: true

- name: Sync dependencies (frozen)
run: uv sync --frozen

- name: Run quality checks
run: uv run nmteam check

- name: Verify POSIX launcher
if: runner.os != 'Windows'
run: scripts/nmteam.sh --help

- name: Verify PowerShell launcher
if: runner.os == 'Windows'
shell: pwsh
run: .\scripts\nmteam.ps1 --help

- name: Verify Batch launcher
if: runner.os == 'Windows'
shell: cmd
run: scripts\nmteam.bat --help
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ target/
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
Expand Down Expand Up @@ -128,7 +125,10 @@ dmypy.json
# Pyre type checker
.pyre/

# nmTeam Doc Generator
/generated
/cache
/mkdocs.yml
# uv / ruff
.ruff_cache/

# Local design and implementation artifacts
/docs/superpowers/

.DS_Store
11 changes: 11 additions & 0 deletions .mdformat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# mdformat 配置:仓库根目录,适用于 docs/ 下所有 .md 文件
# 插件(mdformat-mkdocs、mdformat-front-matters、mdformat-footnote)通过 entry point 自动启用,
# 因此 admonition、content tabs、YAML frontmatter 与脚注均受保护,无需 extensions 列表。
wrap = "keep"
number = false
end_of_line = "lf"
validate = true

[plugin.mkdocs]
# 保持 mdformat-mkdocs 默认行为(4 空格列表缩进、admonition 保护);
# 如后续需要 --align-semantic-breaks-in-lists 等开关,在此追加配置项。
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
135 changes: 135 additions & 0 deletions AGENTS.md

Large diffs are not rendered by default.

164 changes: 123 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,149 @@
# Support
[**nmTeam 支持**](https://support.nmteam.xyz)官方网站。使用 `mkdocs-material` 进行构建。

# 快速开始
[**nmTeam 支持**](https://support.nmteam.xyz)官方网站。使用 `mkdocs-material` 构建;项目由 `uv` 管理依赖,通过 Typer 提供统一的跨平台命令行入口。

## 安装依赖
```bash
# 方式1: 使用管理脚本自动安装
python manage.py install
## 环境要求

# 方式2: 手动安装
pip install -r requirements.txt
```
- Python 3.14+(由 `uv` 按 `.python-version` 自动管理)
- [uv](https://docs.astral.sh/uv/)(`curl -LsSf https://astral.sh/uv/install.sh | sh`)

## 快速开始

### 安装依赖

## 开发模式 (推荐)
```bash
# 启动开发服务器 (支持热更新)
python manage.py dev
uv sync
```

# 或使用便捷脚本 (Windows)
.\dev.ps1 dev
dev.bat dev
### 开发模式

# 或使用便捷脚本 (Linux/macOS)
./dev.sh dev
```bash
uv run nmteam dev
```

开发模式会:
- 自动生成文档结构
- 启动 MkDocs 开发服务器 (http://127.0.0.1:8000)
- 监听 `docs/` 目录文件变化并自动重新生成
- 支持热更新,修改后自动刷新页面

## 构建生产版本
- 让 MkDocs 直接读取 `docs/`,不创建中间目录
- 启动 MkDocs 开发服务器(<http://127.0.0.1:8000>)
- 使用 MkDocs 原生 dirty reload 监听 `docs/`、`assets/` 和重定向配置
- 仅重新读取变更的 Markdown,并仅处理变更的图片资源

### 构建生产版本

```bash
# 构建静态站点
python manage.py build
uv run nmteam build
```

构建结果输出到 `site/` 目录。

MkDocs 插件会在一次构建中完成动态导航、目录页、贡献提示、`llms.txt`、
重定向脚本和图片优化。图片直接并行写入 `site/`,不会创建 `cache/` 或
`generated/` 副本。

最终 HTML 会由 `mkdocs-minify-plugin` 压缩;生成器元标签仅保留 MkDocs
版本,不暴露主题及其版本。

## 静态资源

仓库内资源统一存放在:

- `assets/images/`:PNG、JPEG 图片母版
- `assets/icons/`:SVG 图标
- `assets/styles/`:站点样式

文档使用 `/assets/...` 引用这些资源。生成文档时,每张 PNG 或 JPEG
图片会同时产生:

- WebP 优先版本:质量 80
- 原格式 fallback:JPEG 使用质量 80;PNG 使用 256 色有损量化

Markdown 中仍使用普通图片语法,构建工具会自动输出 WebP
优先的 `<picture>` 元素。外部 URL 不会被下载或镜像。

## AI 支持

站点面向语言模型提供以下能力:

- `/llms.txt`:按 [llmstxt.org](https://llmstxt.org/) 规范生成的站点索引,
每个链接指向页面的 Markdown 版本。
- 每页 Markdown 版本:`nmteam build` 时在每个页面旁生成同路径的 `.md` 文件
(如 `/nmbot-telegram/mcp.md`)。
- 页面顶部的文章操作区(首页不显示):**复制 Markdown** 直接复制当前页面
原文;**使用[品牌图标]打开** 菜单提供 GitHub 源文件、Markdown 版本,
以及 Perplexity、Grok、ChatGPT、Claude Web、Claude Desktop、
Claude Code、OpenAI Codex、Cursor 八种 AI 打开方式。

# 或使用便捷脚本
.\dev.ps1 build
注意:`llms.txt` 与 `.md` 版本由 `nmteam build` 输出到 `site/`;开发模式
(`nmteam dev`)下复制和 View as Markdown 会提示先构建,AI 操作仍可通过
当前页面 URL 打开。

### 预览生产构建

```bash
uv run nmteam preview
```

构建过程会:
1. 运行 `generate.py` 生成文档结构
2. 执行 `mkdocs build` 生成静态站点到 `site/` 目录
`nmteam preview` 默认监听 `127.0.0.1:8124`,可用 `--port` / `--host`
调整。与裸 `python -m http.server` 不同,它把 `.md` 文件的
`Content-Type` 显式设为 `text/plain; charset=utf-8`(Python 3.13+ 的
`mimetypes` 会把 `.md` 判为 `text/markdown`,部分客户端会下载而非内联
显示),保证每页 Markdown 版本在任何浏览器中都能直接阅读。

默认仅输出生命周期摘要和错误。需要 MkDocs 详细日志时,在子命令前添加
全局选项 `--verbose`,例如 `uv run nmteam --verbose build`。

## 平台启动器

直接运行 `uv run nmteam` 是推荐方式。`scripts/` 也提供不包含业务逻辑的薄启动器;它们会自动定位仓库根目录并原样传递参数。

=== "Linux / macOS"

```bash
scripts/nmteam.sh dev
```

=== "PowerShell"

```powershell
.\scripts\nmteam.ps1 dev
```

=== "Windows Batch"

```batch
scripts\nmteam.bat dev
```

## 质量检查

一条命令运行 Ruff lint、Ruff format check、pytest、mdformat 和 MkDocs strict build:

## 其他命令
```bash
# 清理生成的文件
python manage.py clean
uv run nmteam check
```

# 查看帮助
python manage.py help
也可以单独运行:

```bash
uv run ruff check .
uv run ruff format --check .
uv run pytest
uv run mdformat --check README.md docs/
uv run nmteam build
```

# 传统部署方式
以上检查由 CI(`.github/workflows/ci.yml`)自动执行。

## 重定向管理

如果你更喜欢传统的分步操作:
```bash
uv run nmteam redirects list
uv run nmteam redirects add "/old-path/" "/new-path/"
uv run nmteam redirects remove "/old-path/"
```

- 安装依赖 `pip install -r requirements.txt`
- 启动本地服务器 `python -m mkdocs serve`
- 构建生成目录 `python generate.py`
- 构建静态界面 `python -m mkdocs build`
管理命令不会用空配置覆盖损坏的 `redirects.json`;修复配置后再重试即可。

# 贡献
## 贡献

欢迎您在 GitHub 上提出问题并贡献文档。
File renamed without changes
File renamed without changes
File renamed without changes
Loading