Documentation
¶
Overview ¶
Package markup is the Markdown every editable deliverable is written in: front matter, blocks, the ::: directives, ==fields== the buyer replaces, and the language's typography, so authors type plain text and documents and decks read the same source the same way.
Index ¶
- Constants
- Variables
- func Aligns(t *Table) []string
- func HTML(b *strings.Builder, ins []Inline)
- func Keys(settings map[string]Setting) []string
- func Lines(src []byte) []string
- func Numeric(t *Table, col int) bool
- func Parse(lines []string, offset int, o Options) ([]Block, []Problem)
- func Plain(in []Inline) string
- func Tie(s string) string
- func Widths(t *Table) []float64
- type Block
- type Field
- type Figure
- type Inline
- type Issue
- type Item
- type Options
- type Problem
- type Setting
- type Table
Constants ¶
View Source
const ( Para = "p" Heading = "h" // Level 1-3 Title = "title" Subtitle = "subtitle" List = "list" TableKind = "table" ImageKind = "image" PageBreak = "break" Ornament = "ornament" Box = "box" Columns = "columns" Form = "form" Signature = "signature" Notes = "notes" // a slide's speaker notes )
Block kinds.
Variables ¶
View Source
var (
FieldMark = regexp.MustCompile(`==([^=\n]+)==`) // a field in plain text
)
Functions ¶
func Lines ¶
Lines splits a source file into lines. A UTF-8 byte order mark, which some editors write, is dropped, so front matter and a first heading still start the file.
Types ¶
type Block ¶
type Block struct {
Kind string
Level int // heading level
Line int // source line
Center bool
Inlines []Inline
Items []Item // list
Ordered bool
Table *Table
Image *Figure
Children []Block // box
Cols [][]Block // columns
Widths []float64 // column shares
Fields []Field // form, signature
}
Block is one block of a document.
type Inline ¶
type Inline struct {
Text string
Bold, Italic bool
Fill bool // a field the buyer replaces: ==…==, highlighted
Link string // a hyperlink target
Break bool // a line break before the text
}
Inline is a run of text with one look.
type Issue ¶
type Issue struct{ Message, Hint string }
Issue is a problem with a piece of sample text and how to fix it.
type Options ¶
type Options struct {
Lang string
Directives []string // the ::: directives allowed, such as title, columns, notes
Slides bool // a line --- starts the next slide
}
Options are what a deliverable's sources may hold.
Click to show internal directories.
Click to hide internal directories.