仓库查看器

英文名称: Repo Viewer

类型: 通用 | 原作者: QiaoSeFenNv | 发布者/贡献者: HAOSkill GitHub 同步 | 协同共创极客: | 配置完整度: 90%

Skill 描述

Repo Viewer 是一个本地 Web 应用,用于将 GitHub 仓库作为可浏览、可翻译的工作区进行阅读。它专注于大型仓库:按需加载目录,文件在预览窗格中打开,Markdown/文本文件可与中文翻译并排显示。

Skill 内容

# Free providers: google-free, mymemory-free.
TRANSLATE_PROVIDER=google-free

# Translation diagnostics are enabled by default. Set to 0 to silence logs.
TRANSLATE_LOG=1
TRANSLATE_BATCH_CHARS=3200
TRANSLATE_BATCH_ITEMS=24

# Translation proxy is configured explicitly, not auto-detected.
TRANSLATE_PROXY_ENABLED=1
TRANSLATE_PROXY_URL=http://127.0.0.1:7897

补充内容

# Free providers: google-free, mymemory-free.
TRANSLATE_PROVIDER=google-free

# Translation diagnostics are enabled by default. Set to 0 to silence logs.
TRANSLATE_LOG=1
TRANSLATE_BATCH_CHARS=3200
TRANSLATE_BATCH_ITEMS=24

# Translation proxy is configured explicitly, not auto-detected.
TRANSLATE_PROXY_ENABLED=1
TRANSLATE_PROXY_URL=http://127.0.0.1:7897

使用指南与最佳实践

# Repo Viewer Repo Viewer 是一个本地 Web 应用,用于将 GitHub 仓库作为可浏览、可翻译的工作区进行阅读。它专注于大型仓库:按需加载目录,文件在预览窗格中打开,Markdown/文本文件可与中文翻译并排显示。 ## 特性 - 本地仓库读取器:粘贴任意本地仓库路径。 - 惰性文件浏览器:仅扫描已打开的目录,因此在大型仓库上启动速度依然很快。 - 代码预览:默认显示可读的行号和浅色代码块。 - Markdown 预览:标题、列表、代码块、内联代码、链接和本地图片。 - 默认中文对照:Markdown/文本文件以源文件 + 中文翻译视图打开。 - 翻译优化:跳过常见代码/配置文件,保留 Markdown 代码块/内联代码,并对文本进行批处理以减少提供者调用。 - 翻译反馈:翻译运行时,翻译窗格显示加载动画。 - 翻译提供者:仓库本地翻译、免费 Google 端点(含 MyMemory 回退)或 MyMemory。 - 主题:纸张、浅色、深色、护眼绿和高对比度。 ## 使用 npx 运行 ```bash npx @8865a/repo-viewer C:\path\to\repo ``` 或者显式传递选项: ```bash npx @8865a/repo-viewer --root C:\path\to\repo --port 4173 ``` 该命令会启动一个本地 Web 服务器并打印浏览器 URL: ```text Repo Viewer running at http://localhost:4173 ``` 如果未提供仓库路径,Repo Viewer 会打开当前工作目录。 ## 全局安装 ```bash npm install -g @8865a/repo-viewer repo-viewer C:\path\to\repo ``` 有用的 CLI 选项: ```bash repo-viewer --help repo-viewer --version repo-viewer --check --root C:\path\to\repo repo-viewer --root C:\path\to\repo --port 4180 ``` ## 本地开发 ```bash npm start ``` 打开: ```text http://localhost:4173 ``` 默认情况下,应用会读取当前工作目录。 要打开另一个本地仓库,请将其绝对路径粘贴到...