Documentation
¶
Overview ¶
Package achievements owns the M4 "achievements" plugin. It converts base-aggregated statistics into rank-graded badges per upstream's metrics achievements panel.
Index ¶
Constants ¶
const Name = "achievements"
Name is the canonical plugin slug.
Variables ¶
var Plugin plugins.Plugin = &achievementsPlugin{}
Plugin is the singleton registered with the global plugin registry.
Functions ¶
func Partial ¶
Partial renders the classic SVG fragment for the achievements plugin. Mirrors upstream org_repo/source/templates/classic/partials/achievements.ejs.
Output structure:
<section data-section="achievements">
<h2 class="field"><svg trophy/>Achievements</h2>
<div class="row">
<section class="achievements [compact] largeable-flex-wrap">
[for each achievement]:
<div class="achievement ${rank-class} largeable-width-half">
<div class="icon"><svg/>...</div>
<div class="info">
<div class="title">${title}</div>
[detailed only] <div class="text">${description}</div>
</div>
</div>
</section>
</div>
</section>
The upstream icon is a per-achievement inline SVG path (`<%- icon %>` unescaped); our data model only carries the icon NAME (`Icon` field). Until the achievements package ships the per-rank SVG paths, the `<div class="icon">` block holds the trophy octicon as a placeholder (still renders, no bare elements).
Types ¶
type Achievement ¶
type Achievement struct {
ID string `json:"id"`
Rank string `json:"rank"`
Title string `json:"title"`
Description string `json:"description"`
Icon string `json:"icon"`
Value int `json:"value"`
}
Achievement is one rank-graded entry.