markdown

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 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 draws Markdown in lines of a given width, with what each piece of text is rather than its color, which is for the theme to say.

Headings lose their #, list items get a bullet or a box, code and tables keep their columns, and prose wraps at the edge. An image is never fetched: reading it would tell the place it is on that the gist was opened, so it is drawn as one line. HTML is turned into Markdown first, in html.go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Line

type Line []Span

Line is a line drawn.

func Render

func Render(body string, width int) []Line

Render draws body in lines width cells wide.

type Role

type Role int

Role is what a piece of text is.

const (
	Text Role = iota
	Heading
	Subheading
	Rule
	Quote
	QuoteMark
	Mark
	Done
	Todo
	Finished
	Code
	CodeBlock
	CodeLang
	Indented
	Link
	Image
	Cell
	TableLine
)

The roles.

type Span

type Span struct {
	Text string
	Role Role
	Bold bool
	// contains filtered or unexported fields
}

Span is text with one role.

Jump to

Keyboard shortcuts

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