selfdoc v0.15.1 /selfdoc.icons
On this page

Language icon module that provides colorful and monochrome SVG icons for code block headers, with mappings for Python, Go, TypeScript, and other languages.

#selfdoc.icons

#selfdoc.icons

Language icons for code blocks.

Provides small inline SVG icons for common programming languages. Each icon uses viewBox="0 0 16 16" and is kept under 500 bytes. Two variants: colorful (brand colors) and monochrome (currentColor).

#get_icon

python
def get_icon(language, mode='colorful')

Return an inline SVG icon for language, or None if unavailable.

Args:

  • language: Language name (case-insensitive). Aliases are resolved

(e.g. "js" -> "javascript", "sh" -> "bash").

  • mode: One of "colorful", "monochrome", or "none".

"none" always returns None.

Returns:

  • SVG string or None.