markdown

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 2 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package markdown provides a small builder for markdown text, including tables, and helpers for formatting values as markdown.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(v string) string

Code wraps v in backticks as inline code, or returns "" if v is empty.

func Name

func Name(v any) string

Name returns the result of v.Name() if v has such a method, or "".

func String

func String(v any) string

String returns v.String() if v implements fmt.Stringer, or "".

Types

type Markdown

type Markdown struct {
	// contains filtered or unexported fields
}

Markdown accumulates markdown text in memory. The zero value is an empty document ready to use. It is not safe for concurrent use.

func (*Markdown) Print

func (s *Markdown) Print(a ...any)

Print appends the operands formatted as by fmt.Sprint.

func (*Markdown) Printf

func (s *Markdown) Printf(format string, a ...any)

Printf appends the operands formatted as by fmt.Sprintf, followed by a newline.

func (*Markdown) Println

func (s *Markdown) Println(a ...any)

Println appends the operands formatted as by fmt.Sprintln.

func (*Markdown) String

func (s *Markdown) String() string

String returns the accumulated markdown.

func (*Markdown) Table

func (s *Markdown) Table(headers []string, rows [][]string)

Table appends a pretty-printed markdown table with the given headers and rows, sorted alphabetically in ascending order. It panics if the table cannot be formatted.

Jump to

Keyboard shortcuts

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