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

build-pkgdown-site

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

정보

이 스킬은 개발자가 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

Configure and deploy pkgdown documentation website for R package.

When Use

  • Creating documentation site for R package
  • Customizing pkgdown layout, theme, navigation
  • Fixing 404 errors on deployed pkgdown site
  • Migrating between deployment methods

Inputs

  • Required: R package with roxygen2 documentation
  • Required: GitHub repository
  • Optional: Custom theme or branding
  • Optional: Vignettes to include as articles

Steps

Step 1: Initialize pkgdown

usethis::use_pkgdown()

Creates _pkgdown.yml, adds pkgdown to .Rbuildignore.

Got: _pkgdown.yml exists in project root. .Rbuildignore contains pkgdown-related entries.

If fail: Install pkgdown with install.packages("pkgdown"). _pkgdown.yml already exists? Function updates .Rbuildignore without 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 404 errors on GitHub Pages — appends /dev/ to URLs.

Got: _pkgdown.yml contains valid YAML with url, template, navbar, reference, articles sections appropriate for package.

If fail: Validate YAML syntax with online YAML linter. Ensure all function names in reference.contents match actual exported functions.

Step 3: Build Locally

pkgdown::build_site()

Got: docs/ directory created with complete site including index.html, function reference pages, articles.

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

Step 4: Preview Site

pkgdown::preview_site()

Verify navigation, function reference, articles, search work correctly.

Got: Site opens in browser at localhost. All navigation links work, function reference pages render, search returns results.

If fail: Preview doesn't open? Manually open docs/index.html in browser. Pages missing? Check devtools::document() was run before building site.

Step 5: Deploy to GitHub Pages

Method A: GitHub Actions (Recommended)

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

Method B: Manual Branch Deployment

# 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

Got: gh-pages branch exists on remote with site files at root level.

If fail: Push rejected? Ensure you have write access to repository. Using GitHub Actions deployment instead? Skip this step, follow setup-github-actions-ci skill.

Step 6: Configure GitHub Pages

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

Got: Site available at https://username.github.io/packagename/ within a few minutes.

If fail: Site returns 404? Verify Pages source matches deployment method (branch deployment requires "Deploy from a branch"). Check development: mode: release set in _pkgdown.yml.

Step 7: Add URL to DESCRIPTION

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

Got: DESCRIPTION URL field contains both pkgdown site URL and GitHub repository URL, separated by comma.

If fail: R CMD check warns about invalid URLs? Verify pkgdown site actually deployed and accessible before adding URL.

Checks

  • Site builds locally without errors
  • All function reference pages render correctly
  • Articles/vignettes accessible and render properly
  • Search functionality works
  • Navigation links correct
  • Site deploys successfully to GitHub Pages
  • No 404 errors on deployed site
  • development: mode: release set in _pkgdown.yml

Pitfalls

  • 404 errors after deployment: Almost always caused by development: mode: auto (default). Change to mode: release.
  • Missing reference pages: Functions must be exported and documented. Run devtools::document() first.
  • Broken vignette links: Use vignette("name") syntax in cross-references, not file paths.
  • Logo not showing: Place logo at man/figures/logo.png, reference in _pkgdown.yml.
  • Search not working: Requires url field in _pkgdown.yml set correctly.
  • Wrong R binary on hybrid systems: On WSL or Docker, Rscript may resolve to cross-platform wrapper instead of native R. Check with which Rscript && Rscript --version. Prefer native R binary (e.g., /usr/local/bin/Rscript on Linux/WSL) for reliability. See Setting Up Your Environment for R path configuration.

See Also

  • setup-github-actions-ci - automated pkgdown deployment workflow
  • write-roxygen-docs - function documentation appearing on site
  • write-vignette - articles appearing in site navigation
  • release-package-version - trigger site rebuild on release

GitHub 저장소

pjt222/agent-almanac
경로: i18n/caveman/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을 선택하십시오.

스킬 보기