content

package
v0.0.0-...-972218c Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToStringSlice

func ToStringSlice(x interface{}) []string

Types

type Article

type Article struct {
	Header     map[string]interface{}
	Body       []byte
	Tags       StringSet
	Categories StringSet
}

func Parse

func Parse(data []byte) (*Article, error)

func Read

func Read(filename string) (*Article, error)

func (*Article) HTML

func (art *Article) HTML() string

HTML renders an article to HTML in a way that can be content-analyzed by Watson. This includes taking any existing title and description and adding them to the markdown body before converting it to HTML.

func (*Article) Write

func (a *Article) Write(filename string, format Format) error

type Format

type Format int
const (
	TOML Format = iota
	YAML
)

type StringSet

type StringSet struct {
	Values map[string]string
}

func NewStringSet

func NewStringSet(slice []string) StringSet

func (StringSet) AddAll

func (s StringSet) AddAll(slice []string)

func (StringSet) RemoveAll

func (s StringSet) RemoveAll(slice []string)

func (StringSet) Slice

func (s StringSet) Slice() []string

Jump to

Keyboard shortcuts

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