Documentation
¶
Overview ¶
Package meta implements markdown frontmatter parsing for simple folien configuration
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Meta ¶
type Meta struct {
Theme string `yaml:"theme"`
Author string `yaml:"author"`
Date string `yaml:"date"`
Paging string `yaml:"paging"`
}
Meta contains all of the data to be parsed out of a markdown file's header section
func (*Meta) Parse ¶
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/c0rydoras/folien/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)
}
Click to show internal directories.
Click to hide internal directories.