octicons

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package octicons provides helpers for working with GitHub Octicon icons. See https://primer.style/foundations/icons for available icons.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataURI

func DataURI(name string, theme Theme) string

DataURI returns a data URI for the embedded Octicon PNG. The theme parameter specifies which variant to use: - ThemeLight: dark icons for light backgrounds - ThemeDark: light icons for dark backgrounds If the icon is not found in the embedded filesystem, it returns an empty string.

func Icons

func Icons(name string) []mcp.Icon

Icons returns MCP Icon objects for the given octicon name in light and dark themes. Icons are embedded as 24x24 PNG data URIs for offline use and faster loading. The name should be the base octicon name without size suffix (e.g., "repo" not "repo-16"). See https://primer.style/foundations/icons for available icons.

Note: The Sizes field is omitted for backward compatibility with older MCP clients that expect it to be a string rather than an array per the 2025-11-25 MCP spec.

func RequiredIcons

func RequiredIcons() []string

RequiredIcons returns the list of icon names from required_icons.txt. This is the single source of truth for which icons should be embedded.

Types

type Theme

type Theme string

Theme represents the color theme of an icon.

const (
	// ThemeLight is for light backgrounds (dark/black icons).
	ThemeLight Theme = "light"
	// ThemeDark is for dark backgrounds (light/white icons).
	ThemeDark Theme = "dark"
)

Jump to

Keyboard shortcuts

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