Dein README umwandeln

Richte den Befehl mit --readme auf dein README oder übergib Karten-URLs als Argumente. Er gibt jede URL mit der daraus entstandenen Karte aus, listet die übersprungenen und gibt dann die Konfiguration aus oder schreibt sie nach --output. Zum Beispiel wird aus dem README unten die Konfiguration danach.

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

Füge dann den Workflow aus dem Schnellstart hinzu und ersetze die alten Bild-URLs durch die erzeugten Dateien.

Unterstützte Karten

Dienst URL enthält Karten
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

Optionszuordnung

Ihre Option 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

Designnamen werden den 43 Presets zugeordnet, einschließlich Aliassen wie tokyonight, onedark, gruvbox, dark und highcontrast. layout=compact wird zum Stil donut-compact, und donut, donut-vertical und pie werden zu donut.

Drop-in-URLs zum Selbsthosten

Wenn du deinen eigenen Kartenserver betreibst (profile-graphics serve oder den Handler profile-graphics/server), kannst du die alten Bild-URLs behalten und nur die Domain tauschen: Der Server beantwortet die Pfade und Query-Parameter von github-readme-stats und github-readme-streak-stats mit derselben Zuordnung, die migrate nutzt.

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)
Pfad Karte
/api summary
/api/top-langs langs
/api/pin repo-card
/api/wakatime wakatime
/streak, /?user= streak
Ihr Parameter 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
  • Unbekannte Parameter werden ignoriert, ebenso show_icons, line_height, text_bold, number_precision, size_weight, count_weight und stats_format. Ein ungültiger Wert bekommt 400 mit einer Meldung, die den Parameter nennt.
  • Ein Design ohne passendes Preset fällt auf das Standarddesign zurück; Farben sind Hex-Werte mit oder ohne #, und bg_color nimmt auch einen Verlauf wie 30,e96443,904e95.
  • Karten werden für GitHub mit dem Token des Servers gezeichnet. Eine Anfrage ändert nie das Token, den API-Host, die Datenquelle oder die Ausgabe: api_domain wird nicht unterstützt, und /api/wakatime zeigt das Konto des WAKATIME_API_KEY des Servers.
  • type=json von streak-stats wird nicht unterstützt; /github/<user>.json liefert die Statistik als JSON.

Unterschiede

  • Ein Design ohne passendes Preset wird verworfen, und die Konfiguration fällt auf das native Auto-Design zurück.
  • Eigene Farben, Titel und andere Optionen dieser Dienste werden nicht übernommen; setze sie mit theme.colors, svg.frame_title und cards.
  • Der erste gefundene Nutzername gewinnt; ohne ihn steht in der Konfiguration your-username.
  • Die Konfiguration nutzt immer provider: github; ändere das für GitLab oder Codeberg.