markdown

package
v0.0.0-...-768744d Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Heading

type Heading interface {
	Level() int
	Text() string
	Id() string
}

type Html

type Html interface {
	ToHtml() string
}

type MarkdownFile

type MarkdownFile interface {
	Title() Title
	Head() []Html
	MainContent() Html
	Headings() []Heading // TODO: use this to generate TOC
}

func DirectoryIndex

func DirectoryIndex(dirPath string, rootDir string) (MarkdownFile, error)

func ForDirectory

func ForDirectory(dirPath string, rootDir string) (MarkdownFile, error)

func FromFile

func FromFile(filePath string) (MarkdownFile, error)

TODO: cache this so we don't keep parsing everything repeatedly

type Title

type Title interface {
	ToHtml() string
	Text() string
}

Jump to

Keyboard shortcuts

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