Documentation
¶
Index ¶
Constants ¶
View Source
const ZipFileMagicBytes = "PK\x03\x04"
Variables ¶
View Source
var ErrIncorrectISBN10 = errors.New("the given ISBN-10 has an incorrect digit")
View Source
var ErrIncorrectISBN13 = errors.New("the given ISBN-13 has an incorrect digit")
View Source
var ErrInvalidISBN = errors.New("the given string does not have the right number of characters to be an ISBN")
View Source
var ErrInvalidISBN10 = errors.New("the given string has 10 digits, but is not a valid ISBN-10")
View Source
var ErrInvalidISBN13 = errors.New("the given string has 13 digits, but is not a valid ISBN-13")
View Source
var ErrInvalidMelaFile = errors.New("given file is neither a melarecipe nor a melarecipes file")
View Source
var ErrInvalidMelaRecipeFile = errors.New("given file is not a melarecipe file")
View Source
var ErrInvalidMelaRecipesFile = errors.New("given file is not a melarecipes file")
Functions ¶
Types ¶
type MaybeDuration ¶
type MaybeDuration string
type Pages ¶
type Pages []PageRange
func MustParsePages ¶
func ParsePages ¶
func (Pages) CorrectContractions ¶ added in v0.0.4
CorrectContractions returns a new Pages object replacing page spans like "145-6" with the more explicit "145-146"
type PeopleCount ¶
type PeopleCount string
func (PeopleCount) Parse ¶
func (pc PeopleCount) Parse() (uint64, error)
type Recipe ¶
type Recipe struct { Filename string `json:"-"` ID string `json:"id"` Title string `json:"title"` Link string `json:"link"` Text string `json:"text"` Ingredients SectionedSequence `json:"ingredients"` Instructions SectionedSequence `json:"instructions"` Nutrition string `json:"nutrition"` Categories []string `json:"categories"` Notes string `json:"notes"` Images []B64Image `json:"images"` Yield PeopleCount `json:"yield"` PrepTime MaybeDuration `json:"prepTime"` CookTime MaybeDuration `json:"cookTime"` TotalTime MaybeDuration `json:"totalTime"` // contains filtered or unexported fields }
func Open ¶
Open is a smart, file-system based function for opening a .melarecipe or .melarecipes file from disk. For simplicity's sake, it will silently ignore any invalid recipes within a .melarecipes file, use ParseRecipes for greater control.
func ParseRecipe ¶
ParseRecipe parses a known single .melarecipe file into a Recipe-compatible struct
func (*Recipe) ListStandardizations ¶ added in v0.0.4
func (*Recipe) Standardize ¶
type Recipes ¶ added in v0.0.7
type Recipes struct {
// contains filtered or unexported fields
}
func NewRecipesBundle ¶ added in v0.0.7
NewRecipesBundle creates a .melarecipes (zip file) and allows writing new recipes directly to it with .Add().
type SectionedSequence ¶
type SectionedSequence string
func (SectionedSequence) Parse ¶
func (ss SectionedSequence) Parse() map[string][]string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.