The functions are named with a verb first, as collect_stats() is. The card functions are now
plot_contributions_card(), plot_stats_card(), plot_activity_card(),
plot_visitors_card(), plot_actions_card() and plot_code_card(), and example_stats() is
get_example_stats(). The old names are gone, so R code that calls them needs the new ones.
Workflows that use the GitHub Action need no change.
The code card shows the stars again. GitHub now gives the time of each star only to the owners
of a repository, and not to every token of theirs: with the fine-grained token of the rghcard
workflow, and for another user, the chart of the stars at the end of each month said "Nothing in
these months", and the key figures left out the stars of the last 12 months. collect_stats()
now reads GitHub's history of the stars of each day, which it gives to any token, or none.
The table stars has a row for each repository and day with stars, with date and count, in
place of a row for each star with its time in starred, and the stars of an older history are
counted per day as it is read. When GitHub does not give the history of the stars,
collect_stats() warns, and keeps those of the collection before.
view_card() shows a card in the Viewer pane of RStudio or Positron, as a web page that tells
the value of each column and bar when you point at it, or in the Plots pane, as a picture drawn
again to the size of the pane when it is resized. It takes what the card functions return: the
file of a card, SVG or PNG, or its SVG code. The examples of the card functions show their
cards with it, so the help pages on the website show them too.
A new help page, ?rghcard_stats, describes the statistics that collect_stats(),
read_stats() and get_example_stats() return, a list of 14 data frames: what one row of each
table is, and the type and meaning of each column, with what grows and what is replaced at each
collection. Printing the statistics points to it, and counts a table of one row as "1 row".
A new function, generate_card_snippet(), returns the README code that shows the cards, which
use_rghcard_action() prints, for the cards, themes and formats you choose. By default it shows
all six cards, in both themes, as SVG.
The articles are three, written anew:
The articles on each card are gone: the help page of each card function explains its numbers and charts, and the addresses of the old articles lead to the new pages.
The help pages show their links, code and lists, where they showed the Markdown they are
written in, such as [collect_stats()] and backticks.
When GitHub refuses a token, collect_stats() gives the pages of both kinds of token,
fine-grained and classic, and gitcreds::gitcreds_set() for the git credential store.
The documentation was checked against the package: the README asks for R 4.1 or newer, which gh needs, and the description of the action names all six cards.
The axis of a column chart counts in whole numbers: up to 2, it had lines at the halves, which it labeled 0, 1, 1, 1, 2, as on the stars of a code card with 2 stars.
Four new cards, so that each card stays uncluttered:
activity_card(): the pull requests, issues, reviews and new repositories of the user, their
followers, their contributions by type as a ring, their contributions by day of the week,
and the repositories they commit to most.visitors_card(): the unique visitors and cloners of the repositories in the last 14 days,
the sites that sent them and the pages they viewed.actions_card(): the GitHub Actions runs, the share that succeeded, those that failed, the
time they took, the busiest workflows and the repositories whose runs take longest.code_card(): the bytes of code in each language as a ring, the stars at the end of each
month, the largest repositories, and the forks and watchers.Any card can show the charts of any other: panels chooses from all of them. The article
More cards explains them.
The rghcard action draws the six cards, as SVG files: sharp on any screen, and a tenth of the
size of a PNG, which counts in a profile repository that keeps every version of its cards. Its
new inputs are cards, which chooses the cards, format, svg, png or both, and the charts
of the new cards, activity-panels, visitors-panels, actions-panels and code-panels.
days also sets the days of the GitHub Actions card.
A profile that shows the PNG cards of rghcard 0.3.0 shows cards that are no longer updated, and
the run warns of them: change .png to .svg in its README and delete the PNG cards, or keep
PNG cards with format: png.
collect_stats() collects more, in new tables of the history: traffic (GitHub's totals of
its 14 days, with the unique visitors and cloners), referrers and pages (the ten top
referring sites and the ten most viewed pages of each repository), languages (the bytes of
code of each repository in each language), stars (the time of each star, not who gave it),
profile (the followers, and the users followed) and contribution_types (the contributions
of each year by type). repos has the watchers of each repository, and actions the start
and the end of each run. A history of rghcard 0.3.0 still draws every card: the new tables
start with the next collection, and the runs collected before have no times.
use_rghcard_action() has the arguments cards and format, and prints the README code of the
cards it draws.
A ring whose legend has long names, such as "Jupyter Notebook", is a little smaller and thinner, so that the names fit, with the same room for the total in the middle.
"commit_languages") and by repositories ("languages"), are rings:
each language in the color that GitHub gives it, as in the language bar of a repository, with
a legend of the color, the name and the share of each, and the total in the middle. A ring has
five languages at most, and the rest together as "Other". The colors come from GitHub
Linguist, MIT license (inst/COPYRIGHTS); data-raw/language-colors.R updates them.collect_stats() has a new argument, contributions_token,
for the token of the contributions.use_rghcard_action() prints a link that fills in GitHub's form for the token: its name, the
one permission it needs and no expiration, which GitHub would otherwise set to 30 days. The
README and the Get started article give the same link, and the README says how to create the
workflow on GitHub's website.uses: sedzinfo/rghcard@v0 in a
workflow of the profile repository installs R and rghcard on GitHub's machine, collects the
statistics, draws both cards and commits them, with their history. Its inputs choose the themes,
the days and the charts of the cards, private repositories and forks, the folders, and whether
to commit. The README shows the workflow and the inputs.use_rghcard_action() writes a workflow that runs the action.First version.
collect_stats() collects the statistics of the repositories a GitHub user owns: repositories,
stars, forks, languages, release downloads and GitHub Actions runs, and, with a token of the
user, page views and clones. It adds them to a history of CSV files, which keeps the traffic
beyond the 14 days that GitHub keeps. Private repositories and forks are left out unless asked
for. A token that GitHub refuses, because it expired or was revoked, stops it with a message on
how to replace it.stats_card() draws the statistics as a card for a GitHub profile, a PNG or an SVG file, in the
colors of GitHub's dark or light mode: a row of key figures and up to three charts, from page
views, clones and GitHub Actions runs per day, the most viewed, cloned and starred repositories,
and the languages.contributions_card() draws the contributions of the user, the numbers of the contribution
graph of their profile, as a card: the contributions since joining GitHub and in the last 12
months, the commits, the current and longest streaks, the contributions per month, and the
languages by commits and by repositories. collect_stats() collects them from GitHub's GraphQL
API.use_rghcard_action() writes a GitHub Actions workflow into a profile repository, which
installs the latest release of rghcard, collects the statistics, draws both cards and commits
them every week.read_stats() reads the history again, and example_stats() returns made-up statistics to try
the cards without a token.