markdown

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FontmatterDelimeterYAML rune = '-'
	FrontmaterDelimeterTOML rune = '+'
	FrontmaterDelimeterCue  rune = ':'
)

Variables

View Source
var (
	DefaultLightTheme = Theme{
		Color: Color{
			Action:     "#3a86ff",
			Heading:    "#11267",
			Text:       "#11226a",
			Link:       "#335c9c",
			BlockQuote: "#e8ecfb",
			Border:     "#335c4c",
			Table:      "#e8ecfb",
			Shadow:     "#e8ecfb",
		},
		FontFamily: "Georgia",
		FontSize:   12,
	}
)
View Source
var KindActionButton = ast.NewNodeKind("ActionButton")

Functions

func ApplyStyle added in v0.2.3

func ApplyStyle(n ast.Node, style string)

func CopyWithRelativePathPrefix added in v0.0.5

func CopyWithRelativePathPrefix(
	w io.Writer,
	source []byte,
	relativePathPrefix string,
) (err error)

func GetFirstHeadingText added in v0.1.8

func GetFirstHeadingText(source []byte) (result string)

func NewParser added in v0.2.1

func NewParser(theme Theme) parser.Parser

func NewPlaintextRenderer added in v0.0.5

func NewPlaintextRenderer() renderer.Renderer

NewPlaintextRenderer creates and returns a new PlaintextRenderer instance.

func NewRendererHTML added in v0.2.1

func NewRendererHTML() renderer.Renderer

func ParseFrontmatter added in v0.0.5

func ParseFrontmatter(source []byte, delimeter rune) (frontmatter map[string]any, err error)

func SplitFrontmatterFromContent added in v0.0.5

func SplitFrontmatterFromContent(source []byte) (frontmatter, content []byte, delimeter rune, err error)

func SplitOnLastHorizontalRule added in v0.0.5

func SplitOnLastHorizontalRule(data []byte) (most, tail []byte, ok bool)

Types

type ActionButtonInjector added in v0.2.0

type ActionButtonInjector struct{}

func (*ActionButtonInjector) RegisterFuncs added in v0.2.3

func (*ActionButtonInjector) Transform added in v0.2.0

func (g *ActionButtonInjector) Transform(node *ast.Document, reader text.Reader, pc parser.Context)

type ActionButtonNode added in v0.2.0

type ActionButtonNode struct {
	ast.BaseBlock
	Link ast.Link
}

func (*ActionButtonNode) Dump added in v0.2.0

func (n *ActionButtonNode) Dump(source []byte, level int)

func (*ActionButtonNode) Kind added in v0.2.0

func (n *ActionButtonNode) Kind() ast.NodeKind

type Color added in v0.2.3

type Color struct {
	Action     string
	Heading    string
	Text       string
	Link       string
	BlockQuote string
	Border     string // thematic break, tables, code block, blockquote margin
	Table      string // table row background
	Shadow     string // blockquote, table alt row background, inline code
}
type Link struct {
	Name        string
	Destination string
}
func CollectLinks(source []byte) (result []Link)

type Theme added in v0.2.3

type Theme struct {
	Color Color

	FontFamily string
	FontSize   uint8
}

func (Theme) Transform added in v0.2.3

func (t Theme) Transform(node *ast.Document, reader text.Reader, pc parser.Context)

Jump to

Keyboard shortcuts

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