Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v0 source pure

Package badge builds small flat SVG badges ("label | message") and turns them into data: URIs and Markdown images tha...

Overview

Package badge builds small flat SVG badges ("label | message") and turns them into data: URIs and Markdown images that gnoweb renders inline.

It is pure: no state, no realm imports. Text is XML-escaped and capped, and colors come from a fixed palette, so any input gives a well-formed, bounded SVG.

Constants 1

Functions 3

func DataURI

1func DataURI(svg string) string
source

DataURI returns svg as a base64 data:image/svg+xml URI.

func Markdown

1func Markdown(alt, svg, link string) string
source

Markdown returns a Markdown image of svg with alt text alt. If link is not empty, the image links there. link must already be a safe URL.

func SVG

1func SVG(label, message, color string) string
source

SVG returns a badge with label on the left and message on the right, the message on color (one of the palette names; anything else is Grey).

Dependencies

Imports 3

/p/g19wmd95cwm3s0w0c5592tgu3zh4zgrtlggvugnj/bouncer/badge/v0

Imported by indexer

Source Files 3