parser

package
v0.0.0-...-fd3802b Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

* Copyright (c) 2016 Josh Vega * See LICENSE for license details.

* Copyright (c) 2016 Josh Vega * See LICENSE for license details.

* Copyright (c) 2016 Josh Vega * See LICENSE for license details.

Index

Constants

View Source
const (
	METADATA_START = "+++"
	METADATA_END   = "+++"
)

Variables

View Source
var (
	ErrorMissingTitle       = errors.New("Missing title")
	ErrorMissingAuthor      = errors.New("Missing author")
	ErrorMissingDescription = errors.New("Missing description")
	ErrorMissingTemplate    = errors.New("Missing template")
	ErrorNoMetadata         = errors.New("Couldn't find metadata")
)
View Source
var (
	ErrorNotImplemented = errors.New("Not implemented")
	ErrorBadWrite       = errors.New("Unable to write to output file")
)

Functions

This section is empty.

Types

type ConfigData

type ConfigData struct {
	TargetDir string
	Port      int
	Minify    bool
	Error     error
}

func ParseConfig

func ParseConfig(filename string) ConfigData

type PageMetadata

type PageMetadata struct {
	Title       string
	Author      string
	Description string
	Template    string
}

TODO: Make certain fields optional

type PageOutput

type PageOutput struct {
	Name     string
	Metadata PageMetadata
	Content  string
	Error    error
}

func ParsePage

func ParsePage(directory, filename string) *PageOutput

func (PageOutput) GeneratePage

func (page PageOutput) GeneratePage(targetDir string, doMinify bool) error

Jump to

Keyboard shortcuts

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