README'ni dönüştür

Komutu --readme ile README'ne yönlendir ya da kart URL'lerini argüman olarak geçir. Her URL'yi dönüştüğü kartla yazdırır, atladıklarını listeler, sonra yapılandırmayı yazdırır ya da --output dosyasına yazar. Örneğin aşağıdaki README, ardından gelen yapılandırmaya dönüşür.

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

Ardından Hızlı başlangıç sayfasındaki workflow'u ekle ve eski görsel URL'lerini oluşturulan dosyalarla değiştir.

Desteklenen kartlar

Hizmet URL şunu içerir Kartlar
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

Seçenek eşlemesi

Onların seçeneği 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

Tema adları, tokyonight, onedark, gruvbox, dark ve highcontrast gibi takma adlar dahil 43 hazır temayla eşlenir. layout=compact donut-compact stiline, donut, donut-vertical ve pie ise donut olur.

Kendi sunucunda barındırma için uyumlu URL'ler

Kendi kart sunucunu çalıştırıyorsan (profile-graphics serve veya profile-graphics/server işleyicisi), eski görsel URL'lerini koruyup yalnızca alan adını değiştirebilirsin: sunucu github-readme-stats ve github-readme-streak-stats yollarına ve sorgu parametrelerine migrate'in kullandığı aynı eşlemeyle yanıt verir.

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)
Yol Kart
/api summary
/api/top-langs langs
/api/pin repo-card
/api/wakatime wakatime
/streak, /?user= streak
Onların parametresi 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
  • Bilinmeyen parametreler yok sayılır; show_icons, line_height, text_bold, number_precision, size_weight, count_weight ve stats_format de öyle. Geçersiz bir değer, parametrenin adını veren bir mesajla 400 alır.
  • Eşleşen hazır teması olmayan bir tema varsayılan temaya döner; renkler # ile ya da onsuz onaltılık değerlerdir ve bg_color 30,e96443,904e95 gibi bir gradyan da alır.
  • Kartlar sunucu token'ıyla GitHub için çizilir. Bir sorgu token'ı, API sunucusunu, veri kaynağını veya çıktıyı asla değiştirmez: api_domain desteklenmez, /api/wakatime ise sunucunun WAKATIME_API_KEY hesabını gösterir.
  • streak-stats'in type=json seçeneği desteklenmez; /github/<user>.json istatistikleri JSON olarak döndürür.

Farklar

  • Eşleşen hazır teması olmayan bir tema bırakılır ve yapılandırma yerel otomatik temaya döner.
  • Bu hizmetlerin özel renkleri, başlıkları ve diğer seçenekleri aktarılmaz; onları theme.colors, svg.frame_title ve cards ile ayarla.
  • Bulunan ilk kullanıcı adı geçerli olur; yoksa yapılandırmada your-username yazar.
  • Yapılandırma her zaman provider: github kullanır; GitLab veya Codeberg için değiştir.