isocalendar

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 7 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 isocalendar owns the M4 "isocalendar" plugin. It reshapes the contributionsCollection.contributionCalendar payload (already fetched by base.runIndepth when isocalendar's input is enabled) into a week×day matrix and computes streaks.

Contracts: specs/004-m4-github-plugins/contracts/plugin-p1-mvp.md §5 Data model: specs/004-m4-github-plugins/data-model.md E-016

Index

Constants

View Source
const Name = "isocalendar"

Name is the canonical plugin slug.

Variables

View Source
var Plugin plugins.Plugin = &isocalendarPlugin{}

Plugin is the singleton registered with the global plugin registry.

Functions

func Partial

Partial renders the classic SVG fragment for the isocalendar plugin. DOM contract: emits <g class="calendar"> containing one <rect class="calendar-day"> per (week, day) cell.

Types

type ISOWeek

type ISOWeek struct {
	FirstDay string `json:"firstDay"`
	Days     [7]int `json:"days"`
}

ISOWeek holds 7 daily contribution counts for one ISO week.

type Result

type Result struct {
	Skipped       bool      `json:"skipped,omitempty"`
	SkippedReason string    `json:"-"`
	Weeks         []ISOWeek `json:"weeks"`
	Streak        Streak    `json:"streak"`
	Average       float64   `json:"average"`
	Sum           int       `json:"sum"`
	Duration      string    `json:"duration"`
}

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

func (*Result) IsSkipped

func (r *Result) IsSkipped() bool

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

type Streak

type Streak struct {
	Max     int `json:"max"`
	Current int `json:"current"`
}

Streak tracks contribution-day streaks (max ever, currently active).

Jump to

Keyboard shortcuts

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