generate

package
v0.0.0-...-43fd755 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const PageTemplate = `+++
title = %[1]q
+++
`

Variables

View Source
var Def = snek.Def{
	Name: "generate",
	Doc: snek.Doc{
		Summary:     "Generate site.",
		Arguments:   "[flags] [config]",
		Description: usage,
	},
	New: func() snek.Command { return &Command{} },
}
View Source
var ErrSchemaMismatch = errors.New("schema mismatch")
View Source
var ManifestEmbed []byte

Functions

func FilterBuilds

func FilterBuilds(repo *archive.Repo, builds []archive.Build) []archive.Build

Filters out builds meeting some criteria.

- Excludes a build when it is missing API-Dump.json and Full-API-Dump.json. - Excludes a build when a later build has the same GUID and an older date.

func GeneratePages

func GeneratePages(index *index.Root, rootPath string)

func MergeHistory

func MergeHistory(repo *archive.Repo, storedHist *history.Root) *history.Root

Retrieves all builds from repo.

func NormalizeHistoryTags

func NormalizeHistoryTags(hist *history.Root)

Normalizes any tags and security context values within hist to their canonical forms. For example, "WriteOnly" and "writeonly" are considered equivalent tags, which are normalized by selecting which ever has the most uppercase latters.

func ReadHistory

func ReadHistory(histPath string) (storedhist *history.Root, err error)

Reads history JSON from histPath.

func WriteFile

func WriteFile(site, file string, value any) error

Writes JSON to file at path.

func WriteManifest

func WriteManifest(manPath string, manifest Manifest) error

Types

type Command

type Command struct {
	Site       string
	Source     string
	Docs       string
	Update     bool
	NoCache    bool
	Disable    Disable
	CPUProfile string
}

func (*Command) Run

func (c *Command) Run(opt snek.Options) error

func (*Command) SetFlags

func (c *Command) SetFlags(flagset snek.FlagSet)

type Disable

type Disable struct {
	Index   bool // Don't generate index data.
	History bool // Don't write history data (cache).
	Dump    bool // Don't generate dump data.
	Reflect bool // Don't generate reflection metadata.
	Pages   bool // Don't generate website pages.
	Icons   bool // Don't generate icon resources.
}

type Manifest

type Manifest struct {
	Schema string `json:"schema"`
}

func ReadManifest

func ReadManifest(manPath string) (manifest Manifest, err error)

type Pages

type Pages map[string]struct{}

func (Pages) Add

func (p Pages) Add(page string)

func (Pages) Print

func (p Pages) Print()

func (Pages) Remove

func (p Pages) Remove(page string)

Jump to

Keyboard shortcuts

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