Documentation
¶
Overview ¶
Package md provides functionality for parsing markdown into slides.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFrontmatterToMD ¶ added in v0.38.0
ApplyFrontmatterToMD updates or creates a markdown file with frontmatter.
func DiffContents ¶ added in v0.15.0
DiffContents compares two Contents and returns the page numbers that have changed. Page numbers are 1-indexed.
Types ¶
type Config ¶
type Config struct {
Layout string `json:"layout,omitempty"` // layout name
Freeze *bool `json:"freeze,omitempty"` // freeze the page
Ignore *bool `json:"ignore,omitempty"` // ignore the page (skip slide generation)
Skip *bool `json:"skip,omitempty"` // skip the page (do not show in the presentation)
}
Config represents the configuration for a slide.
type Content ¶ added in v0.14.0
type Content struct {
Layout string `json:"layout"`
Freeze *bool `json:"freeze,omitempty"`
Ignore *bool `json:"ignore,omitempty"`
Skip *bool `json:"skip,omitempty"`
Titles []string `json:"titles,omitempty"`
TitleBodies []*deck.Body `json:"-"`
Subtitles []string `json:"subtitles,omitempty"`
SubtitleBodies []*deck.Body `json:"-"`
Bodies []*deck.Body `json:"bodies,omitempty"`
Images []*deck.Image `json:"images,omitempty"`
CodeBlocks []*CodeBlock `json:"code_blocks,omitempty"`
BlockQuotes []*deck.BlockQuote `json:"block_quotes,omitempty"`
Tables []*deck.Table `json:"tables,omitempty"`
Comments []string `json:"comments,omitempty"`
Headings map[int][]string `json:"headings,omitempty"`
}
Content represents a single slide content.
type Contents ¶ added in v0.14.0
type Contents []*Content
Contents represents a collection of slide contents.
type DefaultCondition ¶ added in v1.0.0
type DefaultCondition struct {
If string `json:"if"` // condition to check
Layout string `json:"layout,omitempty"` // layout name to apply if condition is true
Freeze *bool `json:"freeze,omitempty"` // freeze the page
Ignore *bool `json:"ignore,omitempty"` // whether to ignore the page if condition is true
Skip *bool `json:"skip,omitempty"` // whether to skip the page if condition is true
}
type Frontmatter ¶ added in v0.31.0
type Frontmatter struct {
PresentationID string `yaml:"presentationID,omitempty" json:"presentationID,omitempty"` // ID of the Google Slides presentation
Title string `yaml:"title,omitempty" json:"title,omitempty"` // title of the presentation
// Whether to display line breaks in the document as line breaks
Breaks *bool `yaml:"breaks,omitempty" json:"breaks,omitempty"`
// Conditions for default
Defaults []DefaultCondition `yaml:"defaults,omitempty" json:"defaults,omitempty"`
// command to convert code blocks to images
CodeBlockToImageCommand string `yaml:"codeBlockToImageCommand,omitempty" json:"codeBlockToImageCommand,omitempty"`
}
Frontmatter represents YAML frontmatter data.
type MD ¶ added in v0.31.0
type MD struct {
Frontmatter *Frontmatter
Contents Contents
}
MD represents a markdown presentation.
func Parse ¶
Parse parses markdown bytes into contents. It splits the input by "---" delimiters and parses each section as a separate content.
Click to show internal directories.
Click to hide internal directories.