package parser
import "github.com/gohugoio/hugo/parser"
Index ¶
- Constants
- func DetectFrontMatter(mark rune) (f *frontmatterType)
- func FormatSanitize(kind string) string
- func FormatToLeadRune(kind string) rune
- func HandleJSONMetaData(datum []byte) (interface{}, error)
- func HandleTOMLMetaData(datum []byte) (interface{}, error)
- func HandleYAMLMetaData(datum []byte) (interface{}, error)
- func InterfaceToConfig(in interface{}, mark rune) ([]byte, error)
- func InterfaceToFrontMatter(in interface{}, mark rune) ([]byte, error)
- type Page
Constants ¶
const ( // HTMLLead identifies the start of HTML documents. HTMLLead = "<" // YAMLLead identifies the start of YAML frontmatter. YAMLLead = "-" // YAMLDelimUnix identifies the end of YAML front matter on Unix. YAMLDelimUnix = "---\n" // YAMLDelimDOS identifies the end of YAML front matter on Windows. YAMLDelimDOS = "---\r\n" // YAMLDelim identifies the YAML front matter delimiter. YAMLDelim = "---" // TOMLLead identifies the start of TOML front matter. TOMLLead = "+" // TOMLDelimUnix identifies the end of TOML front matter on Unix. TOMLDelimUnix = "+++\n" // TOMLDelimDOS identifies the end of TOML front matter on Windows. TOMLDelimDOS = "+++\r\n" // TOMLDelim identifies the TOML front matter delimiter. TOMLDelim = "+++" // JSONLead identifies the start of JSON frontmatter. JSONLead = "{" // HTMLCommentStart identifies the start of HTML comment. HTMLCommentStart = "<!--" // HTMLCommentEnd identifies the end of HTML comment. HTMLCommentEnd = "-->" // BOM Unicode byte order marker BOM = '\ufeff' )
Functions ¶
func DetectFrontMatter ¶
func DetectFrontMatter(mark rune) (f *frontmatterType)
DetectFrontMatter detects the type of frontmatter analysing its first character.
func FormatSanitize ¶
TODO(bep) move to helpers
func FormatToLeadRune ¶
func HandleJSONMetaData ¶
func HandleTOMLMetaData ¶
func HandleYAMLMetaData ¶
func InterfaceToConfig ¶
func InterfaceToFrontMatter ¶
Types ¶
type Page ¶
type Page interface { FrontMatter() []byte Content() []byte IsRenderable() bool Metadata() (interface{}, error) }
Page represents a parsed content page.
func ReadFrom ¶
ReadFrom reads the content from an io.Reader and constructs a page.
Source Files ¶
- Version
- v0.18.1
- Published
- Dec 29, 2016
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 3 minutes ago –
Tools for package owners.