markdown

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 7 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 reads a work's words as Markdown into a flat list of blocks for a format to lay out. Inline emphasis and links are kept as plain text, and every line break is kept, since most of what it writes is plain text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Kind  Kind
	Text  string // line breaks kept; "" for a rule or a table
	Level int    // a heading's, from 1
	Depth int    // how far in: list items and quotes go one deeper
	Quote bool   // inside a quote
	Mark  string // an item's "•" or "3."
	Tight bool   // a paragraph in a tight list: no space after it
	Rows  [][]string
}

func Blocks

func Blocks(title, body string) []Block

Blocks reads body, leaving out a first line that repeats title.

type Kind

type Kind int
const (
	Paragraph Kind = iota
	Heading
	Item // a list item's first lines; what else it holds follows, one Depth in
	Code
	Rule
	Table
)

Jump to

Keyboard shortcuts

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