Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 source pure

v0 - Unaudited: This is an initial version that has not yet been formally audited. A fully audited version will be pu...

Readme View source

v0 - Unaudited This is an initial version of this package that has not yet been formally audited. A fully audited version will be published as a subsequent release. Use in production at your own risk.

mdalert

Package mdalert provides support for creating Markdown alerts with standard alert types (note, tip, important, warning, caution).

Overview

v0 - Unaudited: This is an initial version that has not yet been formally audited. A fully audited version will be published as a subsequent release. Use in production at your own risk.

Package mdalert provides support for creating Markdown alerts.

Package mdalert provides support for creating Markdown alerts.

It defines supported alert types and helper functions that can be called to generate Markdown for different alert types.

The different alert types are documented in the Markdown docs realm: https://gno.land/r/docs/markdown#alerts

Constants 1

Functions 13

func Caution

1func Caution(title, msg string) string
source

Caution returns an alert Markdown of type caution.

func Cautionf

1func Cautionf(title, format string, a ...any) string
source

Cautionf returns an alert Markdown of type caution with a formatted message.

func Info

1func Info(title, msg string) string
source

Info returns an alert Markdown of type info.

func Infof

1func Infof(title, format string, a ...any) string
source

Infof returns an alert Markdown of type info with a formatted message.

func Note

1func Note(title, msg string) string
source

Note returns an alert Markdown of type note.

func Notef

1func Notef(title, format string, a ...any) string
source

Notef returns an alert Markdown of type note with a formatted message.

func Success

1func Success(title, msg string) string
source

Success returns an alert Markdown of type success.

func Successf

1func Successf(title, format string, a ...any) string
source

Notef returns an alert Markdown of type success with a formatted message.

func Tip

1func Tip(title, msg string) string
source

Tip returns an alert Markdown of type tip.

func Tipf

1func Tipf(title, format string, a ...any) string
source

Tipf returns an alert Markdown of type tip with a formatted message.

func Warning

1func Warning(title, msg string) string
source

Warning returns an alert Markdown of type warning.

func Warningf

1func Warningf(title, format string, a ...any) string
source

Warningf returns an alert Markdown of type warning with a formatted message.

func New

1func New(t Type, title, msg string, folded bool) Alert
source

New creates a new alert.

Types 2

type Alert

struct
 1type Alert struct {
 2	// Type defines the type of alert.
 3	Type Type
 4
 5	// Title contains an optional title for the alert.
 6	Title string
 7
 8	// Message contains alerts's message.
 9	Message string
10
11	// Folded indicates that the alert must be folded on render.
12	// Message is not initially visible when folded, only title is visible.
13	Folded bool
14}
source

Alert defines a type for alerts.

Methods on Alert

func String

method on Alert
1func (a Alert) String() string
source

String returns the alert as a Markdown string.

type Type

ident
1type Type string
source

Type defines a type for the alert types.

Imports 2

Source Files 5