Documentation ¶
Overview ¶
Package meta implements markdown frontmatter parsing for simple slides configuration
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Meta ¶
Meta contains all of the data to be parsed out of a markdown file's header section
func (*Meta) Parse ¶ added in v0.5.0
Parse parses metadata from a slideshows header slide including theme information
If no front matter is provided, it will fallback to the default theme and return false to acknowledge that there is no front matter in this slide
Example ¶
package main import ( "fmt" "github.com/maaslalani/slides/internal/meta" ) func main() { header := ` --- theme: "dark" author: "Gopher" date: "Apr. 4, 2021" paging: "%d" --- ` // Parse the header from the markdown // file m, _ := meta.New().Parse(header) // Print the return theme // meta fmt.Println(m.Theme) fmt.Println(m.Author) fmt.Println(m.Date) fmt.Println(m.Paging) }
Output:
Click to show internal directories.
Click to hide internal directories.