Documentation
¶
Overview ¶
Package notable owns the M4 "notable" plugin. The Go port mirrors upstream source/plugins/notable: it lists the repositories the page user contributed to on *other* users'/organizations' accounts (user.repositoriesContributedTo), defaulting to organization-owned repositories only and excluding the user's own repositories. See issue #447.
Index ¶
Constants ¶
const Name = "notable"
Name is the canonical plugin slug.
Variables ¶
var Plugin plugins.Plugin = ¬ablePlugin{}
Plugin is the singleton registered with the global plugin registry.
Functions ¶
func Partial ¶
Partial renders the classic SVG fragment for the notable plugin, mirroring upstream source/templates/classic/partials/notable.ejs (issue #447). The chip label is the aggregation key chosen by Run: the owner segment ("@huggingface") by default, or the full "@owner/repo" handle when plugin_notable_repositories is enabled.
Basic mode renders only the avatar + owner chip — no star count is drawn (the previous "★ N" badge from #422 was a regression). Indepth mode additionally renders the upstream gauge stack (commits / stars / issues / pulls), each gauge guarded on a non-zero counter.
Returns "" when there is no data (Skipped or empty List). When data arrives it emits the rocket-octicon header followed by a flex row of contribution chips.
Output structure (basic mode):
<section data-section="notable">
<h2 class="field"><svg/>Notable contributions</h2>
<div class="row organization contributions">
[for each contrib]:
<div class="organization contribution {s|a|b|c} ">
<img class="[organization] avatar" src="..." width="16" height="16" />
<span class="name">@${owner}</span>
</div>
</div>
</section>
Types ¶
type NotableContrib ¶
type NotableContrib struct {
// Name is the rendered chip label (without the leading "@").
// Upstream uses the owner segment (handle.split("/").shift(), e.g.
// "@huggingface") by default, or the full "owner/repo" handle when
// plugin_notable_repositories is enabled.
Name string `json:"name"`
// AvatarURL is the owner avatar shown on the chip.
AvatarURL string `json:"avatar,omitempty"`
// Organization marks the chip as an organization (upstream toggles
// the `organization` avatar CSS class accordingly).
Organization bool `json:"organization,omitempty"`
Login string `json:"login"`
Repo string `json:"repo"`
Title string `json:"title"`
Type string `json:"type"`
Indepth bool `json:"indepth"`
Description string `json:"description,omitempty"`
StargazerCount int `json:"stargazerCount,omitempty"`
ForkCount int `json:"forkCount,omitempty"`
// Indepth-only per-repository statistics. The Go port populates
// these from the GraphQL connection where available; user-specific
// commit attribution (upstream's REST-derived percentage /
// maintainer flag) is not computed, so gauges only render when the
// counters are non-zero.
Commits int `json:"commits,omitempty"`
Issues int `json:"issues,omitempty"`
Pulls int `json:"pulls,omitempty"`
Maintainer bool `json:"maintainer,omitempty"`
Percentage float64 `json:"percentage,omitempty"`
}
NotableContrib mirrors one entry from the upstream notable contributions list. Each entry renders an avatar + chip label and, in indepth mode, additional gauge visualizations for the per-repository commit / star / issue / pull counters. See source/plugins/notable/index.mjs and source/templates/classic/ partials/notable.ejs.
type Result ¶
type Result struct {
Skipped bool `json:"skipped,omitempty"`
SkippedReason string `json:"-"`
List []NotableContrib `json:"list"`
}
Result is the JSON payload published under data.Plugins["notable"].