Documentation
¶
Overview ¶
Package md provides functionality for parsing markdown into slides.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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)
Key string `json:"key,omitempty"` // opaque, stable identifier for the page; unique within the deck
}
Config represents the configuration for a slide.
type Content ¶
type Content struct {
Layout string `json:"layout"`
Freeze *bool `json:"freeze,omitempty"`
Ignore *bool `json:"ignore,omitempty"`
Skip *bool `json:"skip,omitempty"`
Key string `json:"key,omitempty"`
Titles []string `json:"titles,omitempty"`
TitleBodies []*slidown.Body `json:"-"`
Subtitles []string `json:"subtitles,omitempty"`
SubtitleBodies []*slidown.Body `json:"-"`
Bodies []*slidown.Body `json:"bodies,omitempty"`
Images []*slidown.Image `json:"images,omitempty"`
CodeBlocks []*CodeBlock `json:"code_blocks,omitempty"`
BlockQuotes []*slidown.BlockQuote `json:"block_quotes,omitempty"`
Tables []*slidown.Table `json:"tables,omitempty"`
Comments []string `json:"comments,omitempty"`
Headings map[int][]string `json:"headings,omitempty"`
}
Content represents a single slide content.
type DefaultCondition ¶
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 ¶
type Frontmatter struct {
Title string `yaml:"title,omitempty" json:"title,omitempty"` // title of the presentation
// Output is the path to the generated .pptx file.
Output string `yaml:"output,omitempty" json:"output,omitempty"`
// 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 ¶
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.