Chuyển đổi README của bạn

Trỏ lệnh tới README bằng --readme, hoặc truyền URL thẻ làm đối số. Nó in từng URL kèm thẻ được tạo ra và liệt kê những URL bị bỏ qua, rồi in cấu hình hoặc ghi vào --output. Ví dụ, README bên dưới trở thành cấu hình theo sau nó.

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

Sau đó thêm workflow từ Hướng dẫn nhanh và thay các URL ảnh cũ bằng tệp đã tạo.

Thẻ được hỗ trợ

Dịch vụ URL chứa Thẻ
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

Ánh xạ tùy chọn

Tùy chọn của họ 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

Tên giao diện được ánh xạ tới 43 giao diện dựng sẵn, kể cả bí danh như tokyonight, onedark, gruvbox, dark và highcontrast. layout=compact thành kiểu donut-compact, còn donut, donut-vertical và pie thành donut.

URL thay thế trực tiếp để tự lưu trữ

Nếu bạn chạy máy chủ thẻ riêng (profile-graphics serve hoặc handler profile-graphics/server), bạn có thể giữ URL ảnh cũ và chỉ đổi tên miền: máy chủ trả lời đường dẫn và tham số truy vấn của github-readme-stats và github-readme-streak-stats với cùng ánh xạ mà migrate dùng.

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)
Đường dẫn Thẻ
/api summary
/api/top-langs langs
/api/pin repo-card
/api/wakatime wakatime
/streak, /?user= streak
Tham số của họ 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
  • Tham số không xác định bị bỏ qua, cũng như show_icons, line_height, text_bold, number_precision, size_weight, count_weight và stats_format. Giá trị không hợp lệ nhận 400 kèm thông báo nêu tên tham số.
  • Giao diện không có bản dựng sẵn tương ứng sẽ dùng giao diện mặc định; màu là giá trị hex có hoặc không có #, và bg_color cũng nhận dải màu như 30,e96443,904e95.
  • Thẻ được vẽ cho GitHub bằng token của máy chủ. Truy vấn không bao giờ đổi token, host API, nguồn dữ liệu hay đầu ra: api_domain không được hỗ trợ, và /api/wakatime hiện tài khoản của WAKATIME_API_KEY trên máy chủ.
  • type=json của streak-stats không được hỗ trợ; /github/<user>.json trả về thống kê dạng JSON.

Khác biệt

  • Giao diện không có bản dựng sẵn tương ứng bị bỏ, và cấu hình quay về giao diện tự động gốc.
  • Màu tùy chỉnh, tiêu đề và các tùy chọn khác của những dịch vụ đó không được chuyển sang; hãy đặt chúng bằng theme.colors, svg.frame_title và cards.
  • Tên người dùng tìm thấy đầu tiên được dùng; nếu không có, cấu hình ghi your-username.
  • Cấu hình luôn dùng provider: github; hãy đổi nó cho GitLab hoặc Codeberg.