README خود را تبدیل کنید

فرمان را با --readme به README خود نشانه بگیرید یا نشانی کارت‌ها را به‌عنوان آرگومان بدهید. هر نشانی را با کارتی که از آن ساخته شد چاپ می‌کند و موارد ردشده را فهرست می‌کند، سپس پیکربندی را چاپ می‌کند یا در --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

سپس گردش‌کار را از شروع سریع بیفزایید و نشانی‌های قدیمی تصویر را با فایل‌های تولیدشده جایگزین کنید.

کارت‌های پشتیبانی‌شده

سرویس نشانی شامل کارت‌ها
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. layout=compact به سبک donut-compact تبدیل می‌شود و donut، donut-vertical و pie به donut.

نشانی‌های جایگزین برای میزبانی شخصی

اگر سرور کارت خودتان را اجرا می‌کنید (profile-graphics serve یا گردانندهٔ profile-graphics/server)، می‌توانید نشانی‌های قدیمی تصویر را نگه دارید و فقط دامنه را عوض کنید: سرور به مسیرها و پارامترهای پرس‌وجوی 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 با پیامی که نام پارامتر را می‌آورد می‌گیرد.
  • پوسته‌ای که پوستهٔ آمادهٔ متناظر ندارد به پوستهٔ پیش‌فرض برمی‌گردد؛ رنگ‌ها مقدارهای هگز با # یا بدون آن هستند و bg_color گرادیانی مثل 30,e96443,904e95 را هم می‌پذیرد.
  • کارت‌ها برای GitHub با توکن سرور کشیده می‌شوند. پرس‌وجو هرگز توکن، میزبان API، منبع داده یا خروجی را تغییر نمی‌دهد: api_domain پشتیبانی نمی‌شود و /api/wakatime حساب مربوط به WAKATIME_API_KEY سرور را نشان می‌دهد.
  • گزینهٔ type=json در streak-stats پشتیبانی نمی‌شود؛ /github/<user>.json آمار را به‌صورت JSON برمی‌گرداند.

تفاوت‌ها

  • پوسته‌ای که پوستهٔ آمادهٔ متناظر ندارد کنار گذاشته می‌شود و پیکربندی به پوستهٔ خودکار بومی برمی‌گردد.
  • رنگ‌های سفارشی، عنوان‌ها و دیگر گزینه‌های آن سرویس‌ها منتقل نمی‌شوند؛ آن‌ها را با theme.colors، svg.frame_title و cards تنظیم کنید.
  • نخستین نام کاربری پیداشده برگزیده می‌شود؛ بدون آن، پیکربندی your-username را می‌نویسد.
  • پیکربندی همیشه از provider: github استفاده می‌کند؛ برای GitLab یا Codeberg آن را تغییر دهید.