Converti il tuo README

Punta il comando al tuo README con --readme, oppure passa gli URL delle schede come argomenti. Stampa ogni URL con la scheda che ne è risultata ed elenca quelli saltati, poi stampa la configurazione o la scrive in --output. Per esempio, il README qui sotto diventa la configurazione che segue.

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

Poi aggiungi il workflow dalla guida rapida e sostituisci i vecchi URL delle immagini con i file generati.

Schede supportate

Servizio L’URL contiene Schede
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

Corrispondenza delle opzioni

La loro opzione 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

I nomi dei temi vengono associati ai 43 temi predefiniti, alias compresi, come tokyonight, onedark, gruvbox, dark e highcontrast. layout=compact diventa lo stile donut-compact, e donut, donut-vertical e pie diventano donut.

URL compatibili per il self-hosting

Se gestisci un tuo server delle schede (profile-graphics serve o l’handler profile-graphics/server), puoi tenere i vecchi URL delle immagini e cambiare solo il dominio: il server risponde ai percorsi e ai parametri di github-readme-stats e github-readme-streak-stats con la stessa corrispondenza usata da 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)
Percorso Scheda
/api summary
/api/top-langs langs
/api/pin repo-card
/api/wakatime wakatime
/streak, /?user= streak
Il loro parametro 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
  • I parametri sconosciuti vengono ignorati, così come show_icons, line_height, text_bold, number_precision, size_weight, count_weight e stats_format. Un valore non valido riceve 400 con un messaggio che indica il parametro.
  • Un tema senza un tema predefinito corrispondente ripiega sul tema predefinito; i colori sono valori esadecimali con o senza #, e bg_color accetta anche un gradiente come 30,e96443,904e95.
  • Le schede vengono disegnate per GitHub con il token del server. Una query non cambia mai il token, l’host dell’API, la fonte dei dati o l’output: api_domain non è supportato, e /api/wakatime mostra l’account del WAKATIME_API_KEY del server.
  • type=json di streak-stats non è supportato; /github/<user>.json restituisce le statistiche in JSON.

Differenze

  • Un tema senza un tema predefinito corrispondente viene scartato, e la configurazione ripiega sul tema automatico nativo.
  • Colori personalizzati, titoli e altre opzioni di quei servizi non vengono riportati; impostali con theme.colors, svg.frame_title e cards.
  • Vince il primo nome utente trovato; senza, la configurazione riporta your-username.
  • La configurazione usa sempre provider: github; cambialo per GitLab o Codeberg.