关于
This skill builds and deploys a pkgdown documentation site for an R package to GitHub Pages. It handles configuration, theming, article organization, and deployment setup. Use it when creating or customizing a package's documentation site or fixing deployment issues like 404 errors.
快速安装
Claude Code
推荐npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/build-pkgdown-site在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
建 pkgdown 站
配發 R 包之 pkgdown 文站。
用
- 為 R 包造文站
- 客 pkgdown 布、題、導
- 修已發 pkgdown 站之 404 誤
- 移發法
入
- 必:含 roxygen2 文之 R 包
- 必:GitHub 庫
- 可:客題或品牌
- 可:涵為篇之 vignette
行
一:初 pkgdown
usethis::use_pkgdown()
此造 _pkgdown.yml 且加 pkgdown 至 .Rbuildignore。
得: _pkgdown.yml 存案根。.Rbuildignore 含 pkgdown 相條。
敗: 以 install.packages("pkgdown") 裝 pkgdown。若 _pkgdown.yml 已存→函更 .Rbuildignore 而不覆配。
二:配 _pkgdown.yml
url: https://username.github.io/packagename/
development:
mode: release
template:
bootstrap: 5
bootswatch: flatly
navbar:
structure:
left: [intro, reference, articles, news]
right: [search, github]
components:
github:
icon: fa-github
href: https://github.com/username/packagename
reference:
- title: Core Functions
desc: Primary package functionality
contents:
- main_function
- helper_function
- title: Utilities
desc: Helper and utility functions
contents:
- starts_with("util_")
articles:
- title: Getting Started
contents:
- getting-started
- title: Advanced Usage
contents:
- advanced-features
- customization
要:設 development: mode: release。默 mode: auto 致 GitHub Pages 之 404,因附 /dev/ 於 URL。
得: _pkgdown.yml 含有效 YAML 附 url、template、navbar、reference、articles 段合包。
敗: 以網上 YAML 解器驗法。確 reference.contents 之諸函名合實導函。
三:本地構
pkgdown::build_site()
得: docs/ 目已造附全站含 index.html、函引頁、篇。
敗: 常題:pandoc 缺(於 .Renviron 設 RSTUDIO_PANDOC)、vignette 依缺(裝薦包)、例破(修或以 \dontrun{} 包)。
四:預覽站
pkgdown::preview_site()
驗導、函引、篇、搜正。
得: 站於 localhost 開於瀏。諸導連行、函引頁渲、搜返結。
敗: 預覽不開→手開 docs/index.html。頁缺→察 devtools::document() 構前已行。
五:發至 GitHub Pages
法 A:GitHub Actions(薦)
詳 setup-github-actions-ci 技之 pkgdown 流。
法 B:手枝發
# Build site
Rscript -e "pkgdown::build_site()"
# Create gh-pages branch if it doesn't exist
git checkout --orphan gh-pages
git rm -rf .
cp -r docs/* .
git add .
git commit -m "Deploy pkgdown site"
git push origin gh-pages
# Switch back to main
git checkout main
得: gh-pages 枝存於遠附站檔於根級。
敗: 推拒→確有庫書權。若用 GitHub Actions 發→略此步而從 setup-github-actions-ci。
六:配 GitHub Pages
- 至庫 Settings > Pages
- 設 Source 為「Deploy from a branch」
- 擇
gh-pages枝、/ (root)目 - 存
得: 站於數分內於 https://username.github.io/packagename/ 可達。
敗: 站返 404→驗 Pages 源合發法(枝發需「Deploy from a branch」)。察 _pkgdown.yml 設 development: mode: release。
七:加 URL 至 DESCRIPTION
URL: https://username.github.io/packagename/, https://github.com/username/packagename
得: DESCRIPTION URL 欄含 pkgdown 站 URL 與 GitHub 庫 URL,逗分。
敗: R CMD check 警 URL 無效→先驗 pkgdown 站實發且可達而後加 URL。
驗
- 站於本地無誤構
- 諸函引頁正渲
- 篇/vignette 可達且正渲
- 搜功行
- 導連正
- 站成發至 GitHub Pages
- 已發站無 404 誤
-
_pkgdown.yml設development: mode: release
忌
- 發後 404 誤:幾皆因
development: mode: auto(默)。改mode: release。 - 函引頁缺:函必導出且錄。先行
devtools::document()。 - vignette 連破:交引中用
vignette("name")法,非檔徑。 - 標誌不現:標誌置
man/figures/logo.png且於_pkgdown.yml引。 - 搜不行:需
_pkgdown.yml之url欄正設。 - 混系 R 執誤:WSL/Docker 上
Rscript或解為跨平包裝非原 R。察which Rscript && Rscript --version。宜用原 R(如 Linux/WSL/usr/local/bin/Rscript)以穩。詳 Setting Up Your Environment。
參
setup-github-actions-ci— 自動 pkgdown 發流write-roxygen-docs— 現於站之函文write-vignette— 現於站導之篇release-package-version— 發時觸站重構
GitHub 仓库
Frequently asked questions
What is the build-pkgdown-site skill?
build-pkgdown-site is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform build-pkgdown-site-related tasks without extra prompting.
How do I install build-pkgdown-site?
Use the install commands on this page: add build-pkgdown-site to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does build-pkgdown-site belong to?
build-pkgdown-site is in the Meta category, tagged word and design.
Is build-pkgdown-site free to use?
Yes. build-pkgdown-site is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.
相关推荐技能
Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。
这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。
该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。
SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。
