achievements

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const Name = "achievements"

Name is the canonical plugin slug.

Variables

View Source
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.

type Result

type Result struct {
	Skipped       bool              `json:"skipped,omitempty"`
	SkippedReason string            `json:"-"`
	Display       string            `json:"display"`
	List          []Achievement     `json:"list"`
	Ranks         map[string]string `json:"ranks"`
}

Result is the JSON payload published under data.Plugins["achievements"].

func (*Result) IsSkipped

func (r *Result) IsSkipped() bool

IsSkipped lets the classic dispatcher detect the skipped path uniformly across plugins.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL