Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶ added in v0.0.6
func Run(in string, out string, maxHeight int, maxWidth int, theme string, templateSize string, fontSize int, dpi int) error
Run is a subcommand `mdsplit`
Flags:
in: --in (default: "") Markdown input file, or stdin when empty out: --out (default: ".") Output directory for the split files maxHeight: --max-height (default: 0) Maximum height of a slide in lines. Overridden by template selection. maxWidth: --max-width (default: 0) Maximum width of a slide in pixels. Overridden by template selection. theme: --theme (default: "light") light or dark templateSize: --template-size (default: "") Predefined template size. fontSize: --font-size (default: 12) Font size in points dpi: --dpi (default: 96) DPI for rendering
Valid template sizes are: card, horizontal-card, presentation, a4.
func Split ¶
func Split(data []byte, opts SplitOptions) error
Split takes a Markdown file as a byte slice and splits it into smaller files.
Types ¶
type SplitOptions ¶
type SplitOptions struct {
OutDir string
MaxHeight int
MaxWidth int
Theme string
TemplateSize TemplateSize // Predefined template size (overrides MaxHeight/MaxWidth if set)
FontSize int // Font size in points (default: 12)
DPI int // DPI for rendering (default: 96)
}
SplitOptions holds the configuration for splitting the Markdown file.
type TemplateSize ¶ added in v0.0.4
type TemplateSize string
TemplateSize represents predefined template dimensions
const ( // TemplateSizeCard is a vertical card format (600x800px at 96 DPI ≈ 25 lines) TemplateSizeCard TemplateSize = "card" // TemplateSizeHorizontalCard is a horizontal card format (800x600px at 96 DPI ≈ 18 lines) TemplateSizeHorizontalCard TemplateSize = "horizontal-card" // TemplateSizePresentation is a standard presentation format (1920x1080px at 96 DPI ≈ 40 lines) TemplateSizePresentation TemplateSize = "presentation" // TemplateSizeA4 is an A4 page format (794x1123px at 96 DPI ≈ 50 lines) TemplateSizeA4 TemplateSize = "a4" )
Click to show internal directories.
Click to hide internal directories.