README 변환하기

--readme로 README를 지정하거나 카드 URL을 인수로 넘기세요. 각 URL과 바뀐 카드를 출력하고 건너뛴 URL을 나열한 다음, 설정을 출력하거나 --output에 씁니다. 예를 들어 아래 README는 그 뒤에 나오는 설정이 됩니다.

shell
npx profile-graphics migrate --readme README.md --output profile-graphics.yml
npx profile-graphics migrate "https://github-readme-stats.vercel.app/api?username=octocat"
README.md
![Stats](https://github-readme-stats.vercel.app/api?username=octocat&theme=tokyonight&hide_border=true)
![Languages](https://github-readme-stats.vercel.app/api/top-langs?username=octocat&layout=compact&langs_count=8)
![Streak](https://streak-stats.demolab.com?user=octocat&theme=tokyonight)
![Trophies](https://github-profile-trophy.vercel.app/?username=octocat&column=4&row=2)
profile-graphics.yml
# yaml-language-server: $schema=https://unpkg.com/profile-graphics/profile-graphics.schema.json
provider:
  type: github
  user: octocat
charts:
  - summary
  - langs
  - streak
  - trophy
theme:
  preset: tokyo-night
svg:
  frame: none
cards:
  langs:
    style: donut-compact
    count: 8
  trophy:
    columns: 4
    max: 8

그런 다음 빠른 시작의 워크플로를 추가하고 예전 이미지 URL을 생성된 파일로 바꾸세요.

지원하는 카드

서비스 URL에 포함 카드
github-readme-stats /api summary
github-readme-stats /api/top-langs langs
github-readme-stats /api/wakatime coding-languages
github-readme-streak-stats streak-stats streak
github-profile-trophy github-profile-trophy trophy
github-readme-activity-graph activity-graph activity
github-profile-summary-cards profile-details, productive-time, stats, repos-per-language, most-commit-language profile-details, productive-time, summary, langs

옵션 대응표

기존 옵션 profile-graphics
username, user provider.user
theme theme.preset
hide_border=true svg.frame: none
locale calendar.locale
layout cards.langs.style
langs_count cards.langs.count
hide cards.langs.exclude
column, row cards.trophy.columns, cards.trophy.max
days cards.activity.days

테마 이름은 tokyonight, onedark, gruvbox, dark, highcontrast 같은 별칭을 포함해 43개 프리셋과 대응됩니다. layout=compact는 donut-compact 스타일이 되고, donut, donut-vertical, pie는 donut이 됩니다.

셀프 호스팅용 호환 URL

직접 카드 서버(profile-graphics serve 또는 profile-graphics/server 핸들러)를 운영한다면 예전 이미지 URL을 그대로 두고 도메인만 바꿀 수 있습니다. 서버는 github-readme-stats와 github-readme-streak-stats의 경로와 쿼리 매개변수에 migrate와 같은 대응표로 응답합니다.

README.md
![Stats](https://cards.example.com/api?username=octocat&show_icons=true&theme=radical)
![Languages](https://cards.example.com/api/top-langs?username=octocat&layout=compact)
![Streak](https://cards.example.com/?user=octocat&theme=dark)
경로 카드
/api summary
/api/top-langs langs
/api/pin repo-card
/api/wakatime wakatime
/streak, /?user= streak
기존 매개변수 profile-graphics
username, user provider.user
hide, show cards.summary.metrics
hide_rank, rank_icon cards.summary.show_rank, rank_style
include_all_commits provider.commits_scope: all
count_private provider.count_private
commits_year calendar.year
number_format, short_numbers svg.number_format
custom_title, hide_title cards.<card>.title, hide_title
card_width, card_height cards.<card>.width, height
hide_border, border_radius svg.frame: none, svg.frame_radius
disable_animations svg.animation: none
theme, locale theme.preset, calendar.locale
title_color, icon_color theme.colors.chart.accent, accent2
text_color, bg_color, border_color theme.colors.text, background, border
layout, langs_count, hide cards.langs.style, count, exclude
exclude_repo provider.exclude_repos
repo, show_owner, description_lines_count cards.repo_card.repo, show_owner, description_lines
layout, langs_count, display_format cards.wakatime.layout, limit, display_format
hide, range, hide_progress cards.wakatime.hide, range, layout: list
mode, exclude_days, date_format cards.streak.mode, exclude_days, date_format
hide_total_contributions, hide_current_streak, hide_longest_streak cards.streak.show
type output.format
background, border theme.colors.background, border
ring, fire, currStreakNum, sideNums, currStreakLabel, sideLabels, dates, stroke cards.streak.colors
  • 알 수 없는 매개변수는 무시되며, show_icons, line_height, text_bold, number_precision, size_weight, count_weight, stats_format도 마찬가지입니다. 잘못된 값은 매개변수 이름이 담긴 메시지와 함께 400을 받습니다.
  • 대응하는 프리셋이 없는 테마는 기본 테마로 대체됩니다. 색은 #이 있거나 없는 16진수 값이며, bg_color는 30,e96443,904e95 같은 그라디언트도 받습니다.
  • 카드는 서버 토큰으로 GitHub용으로 그립니다. 쿼리로는 토큰, API 호스트, 데이터 소스, 출력을 바꿀 수 없습니다. api_domain은 지원하지 않으며, /api/wakatime은 서버의 WAKATIME_API_KEY 계정을 보여 줍니다.
  • streak-stats의 type=json은 지원하지 않습니다. /github/<user>.json이 통계를 JSON으로 반환합니다.

차이점

  • 대응하는 프리셋이 없는 테마는 빠지고, 설정은 네이티브 자동 테마로 돌아갑니다.
  • 해당 서비스의 사용자 지정 색, 제목, 기타 옵션은 옮겨지지 않습니다. theme.colors, svg.frame_title, cards로 설정하세요.
  • 처음 찾은 사용자 이름을 씁니다. 없으면 설정에 your-username이 들어갑니다.
  • 설정은 항상 provider: github를 씁니다. GitLab이나 Codeberg라면 바꾸세요.