markdown

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, blocks []Block) error

Write serializes a slice of Blocks to markdown, writing the result to w.

Types

type Block

type Block interface {
	Type() string
}

Block is an element in a showboat document.

func Parse

func Parse(r io.Reader) ([]Block, error)

Parse reads markdown from r and returns a slice of Blocks. The input is expected to be in the format produced by Write.

type CodeBlock

type CodeBlock struct {
	Lang    string
	Code    string
	IsImage bool
}

CodeBlock is an executable fenced code block.

func (CodeBlock) Type

func (b CodeBlock) Type() string

type CommentaryBlock

type CommentaryBlock struct {
	Text string
}

CommentaryBlock is free-form markdown prose.

func (CommentaryBlock) Type

func (b CommentaryBlock) Type() string

type ImageOutputBlock

type ImageOutputBlock struct {
	AltText  string
	Filename string
}

ImageOutputBlock is a captured image reference from an image code block.

func (ImageOutputBlock) Type

func (b ImageOutputBlock) Type() string

type OutputBlock

type OutputBlock struct {
	Content string
}

OutputBlock is captured text output from a code block.

func (OutputBlock) Type

func (b OutputBlock) Type() string

type TitleBlock

type TitleBlock struct {
	Title     string
	Timestamp string
	Version   string
}

TitleBlock is the document header: an H1 title and a timestamp.

func (TitleBlock) Type

func (b TitleBlock) Type() string

Jump to

Keyboard shortcuts

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