Documentation
¶
Overview ¶
Package ascii provides functionality for generating ASCII art representations of GitHub contribution graphs.
Index ¶
Constants ¶
const ( // Basic blocks EmptyBlock = ' ' // Represents days with no contributions FutureBlock = '.' // Represents future dates // Foundation blocks (bottom layer) FoundationLow = '░' // 1-33% intensity FoundationMed = '▒' // 34-66% intensity FoundationHigh = '▓' // 67-100% intensity // Middle blocks (intermediate layers) MiddleLow = '░' MiddleMed = '▒' MiddleHigh = '▓' // Top blocks (highest layer, using special characters for visual distinction) TopLow = '╻' // Lower intensity peak TopMed = '┃' // Medium intensity peak TopHigh = '╽' // High intensity peak )
Block character sets for different contribution levels. The ASCII art uses different characters depending on the position (foundation, middle, top) and intensity (low, medium, high) of contributions.
const ( LowThreshold = 0.33 // 33% of max contributions MediumThreshold = 0.66 // 66% of max contributions )
Contribution level thresholds as percentages of the maximum contribution count
const GridWidth = 53
GridWidth defines the standard width for the ASCII output.
const HeaderTemplate = `` /* 447-byte string literal not displayed */
HeaderTemplate contains the ASCII art header for the output.
Variables ¶
var ErrInvalidGrid = errors.New("invalid contribution grid")
ErrInvalidGrid is returned when the contribution grid is invalid
Functions ¶
func GenerateASCII ¶
func GenerateASCII(contributionGrid [][]types.ContributionDay, username string, year int, includeHeader bool, includeUserInfo bool) (string, error)
GenerateASCII creates a 2D ASCII art representation of the contribution data. It returns the generated ASCII art as a string and an error if the operation fails. When includeHeader is true, the output includes the header template.
Types ¶
This section is empty.