MCP HubMCP Hub
스킬 목록으로 돌아가기

build-pkgdown-site

pjt222
업데이트됨 2 days ago
2 조회
17
2
17
GitHub에서 보기
메타worddesign

정보

이 Claude Skill은 R 패키지의 pkgdown 문서 사이트를 빌드하고 GitHub Pages에 배포합니다. 설정, 테마 적용, 문서 구성 및 브랜치 기반 또는 GitHub Actions와 같은 배포 방법을 다룹니다. 패키지 문서 사이트를 생성하거나 맞춤 설정, 배포 문제 해결, 배포 방법 간 마이그레이션에 활용할 수 있습니다.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/build-pkgdown-site

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Build pkgdown Site

Config + deploy pkgdown doc site for R pkg.

Use When

  • Doc site for R pkg
  • Customize pkgdown layout, theme, nav
  • Fix 404s on deployed pkgdown site
  • Migrate between deploy methods

In

  • Required: R pkg w/ roxygen2 docs
  • Required: GitHub repo
  • Optional: Custom theme/branding
  • Optional: Vignettes to include as articles

Do

Step 1: Init pkgdown

usethis::use_pkgdown()

Creates _pkgdown.yml + adds pkgdown to .Rbuildignore.

_pkgdown.yml in project root. .Rbuildignore has pkgdown entries.

If err: Install pkgdown via install.packages("pkgdown"). _pkgdown.yml already exists → fn updates .Rbuildignore w/o overwriting config.

Step 2: Configure _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

Critical: Set development: mode: release. Default mode: auto causes 404s on GitHub Pages (appends /dev/ to URLs).

_pkgdown.yml valid YAML w/ url, template, navbar, reference, articles appropriate for pkg.

If err: Validate YAML syntax w/ online linter. All fn names in reference.contents match actual exported fns.

Step 3: Build Locally

pkgdown::build_site()

docs/ dir created w/ complete site incl index.html, fn ref pages, articles.

If err: Common issues: missing pandoc (set RSTUDIO_PANDOC in .Renviron), missing vignette deps (install suggested pkgs), broken examples (fix or wrap in \dontrun{}).

Step 4: Preview

pkgdown::preview_site()

Verify nav, fn ref, articles, search work.

Site opens in browser at localhost. Nav links work, ref pages render, search returns results.

If err: Preview doesn't open → manually open docs/index.html. Pages missing → check devtools::document() ran before build.

Step 5: Deploy to GitHub Pages

Method A: GitHub Actions (Recommended)

See setup-github-actions-ci skill for pkgdown workflow.

Method B: Manual Branch Deploy

# 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 branch on remote w/ site files at root.

If err: Push rejected → ensure write access. Using GitHub Actions instead → skip + follow setup-github-actions-ci.

Step 6: Configure GitHub Pages

  1. Repo Settings > Pages
  2. Source: "Deploy from a branch"
  3. Select gh-pages branch, / (root) folder
  4. Save

Site available at https://username.github.io/packagename/ within min.

If err: 404 → verify Pages source matches deploy method (branch deploy needs "Deploy from a branch"). Check development: mode: release in _pkgdown.yml.

Step 7: Add URL to DESCRIPTION

URL: https://username.github.io/packagename/, https://github.com/username/packagename

DESCRIPTION URL has pkgdown site URL + GitHub repo URL, comma-separated.

If err: R CMD check warns invalid URLs → verify pkgdown site actually deployed + accessible before adding.

Check

  • Builds locally w/o errs
  • All fn ref pages render
  • Articles/vignettes accessible + render
  • Search works
  • Nav links correct
  • Deploys to GitHub Pages
  • No 404s
  • development: mode: release set

Traps

  • 404 after deploy: Almost always development: mode: auto (default). → mode: release
  • Missing ref pages: Fns must be exported + documented. Run devtools::document() first
  • Broken vignette links: Use vignette("name") syntax for cross-refs, not file paths
  • Logo not showing: Place at man/figures/logo.png, ref in _pkgdown.yml
  • Search not working: Needs url field in _pkgdown.yml set correctly
  • Wrong R binary hybrid sys: WSL/Docker → Rscript may resolve to cross-platform wrapper vs native. Check which Rscript && Rscript --version. Prefer native (e.g., /usr/local/bin/Rscript on Linux/WSL). See Setting Up Your Environment

  • setup-github-actions-ci — automated pkgdown deploy workflow
  • write-roxygen-docs — fn docs that appear on site
  • write-vignette — articles in site nav
  • release-package-version — trigger rebuild on release

GitHub 저장소

pjt222/agent-almanac
경로: i18n/caveman-ultra/skills/build-pkgdown-site
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

content-collections

메타

이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.

스킬 보기

polymarket

메타

이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.

스킬 보기

creating-opencode-plugins

메타

이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.

스킬 보기

sglang

메타

SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.

스킬 보기