parse

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Parses markdown to html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	Title       string   `yaml:"title"`
	Description string   `yaml:"description"`
	Date        string   `yaml:"date"`
	DateUpdated string   `yaml:"dateUpdated"`
	Layout      string   `yaml:"layout"`
	Tags        []string `yaml:"tags"`
	Pinned      bool     `yaml:"pinned"`
	Unlisted    bool     `yaml:"unlisted"`
	Draft       bool     `yaml:"draft"`
	TOC         bool     `yaml:"toc"`
	ShowHeader  bool     `yaml:"showHeader"`
}

Allowed frontmatter in unmarshalled YAML.

Default values

* Pinned: false

* Unlisted: false

* ShowHeader: true

* Layout: "list"

* Draft: false

* TOC: false

func DefaultMetadata

func DefaultMetadata() Metadata

type Source added in v0.1.1

type Source struct {
	B           []byte
	IsTOC       bool
	IsHighlight bool
}
func (s *Source) ParseInternalLinks() ([]string, []string, error)

Parse b to find all other links within the document.

func (*Source) ParseMetadata added in v0.1.1

func (s *Source) ParseMetadata() (Metadata, error)

Parse metadata (frontmatter) from source b.

func (*Source) ParseSource added in v0.1.1

func (s *Source) ParseSource() ([]byte, error)

Read in b and parse body. Frontmatter is reprocessed to strip it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL