Documentation
¶
Index ¶
- type SiteConfig
- func (cfg SiteConfig) CatalogAndChildrenToHtml() error
- func (cfg SiteConfig) CatalogModuleAndChildrenToHtml(catMod wfapi.CatalogModule) error
- func (cfg SiteConfig) CatalogModuleToHtml(catMod wfapi.CatalogModule) error
- func (cfg SiteConfig) CatalogToHtml() error
- func (cfg SiteConfig) ReleaseToHtml(catMod wfapi.CatalogModule, rel wfapi.CatalogRelease) error
- func (cfg SiteConfig) ReplayToHtml(catMod wfapi.CatalogModule, rel wfapi.CatalogRelease, replayPlot wfapi.Plot) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SiteConfig ¶
type SiteConfig struct {
Ctx context.Context
// Data Access Broker for getting Catalog info.
// Some functions pass around data in memory,
// but sometimes those objects just contain CIDs, which we'll need to go load.
// This has helper functions that do the loading.
// Arguably should be a parameter, but would end up in almost every single function, so, eh.
Cat_dab workspace.Catalog
// A plain string for output path prefix is used because golang still lacks
// an interface for filesystem *writing* -- io/fs is only reading. Sigh.
OutputPath string
// Set to "/" if you'll be publishing at the root of a subdomain.
URLPrefix string
// URL to warehouse to use for download links in generated HTML
// If nil, download links will be disabled
DownloadURL *string
}
func (SiteConfig) CatalogAndChildrenToHtml ¶
func (cfg SiteConfig) CatalogAndChildrenToHtml() error
CatalogAndChildrenToHtml performs CatalogToHtml, and also procedes to invoke the html'ing of all modules within. Additionally, it does all the other "once" things (namely, outputs a copy of the css).
Errors:
- warpforge-error-io -- in case of errors writing out the new html content.
- warpforge-error-internal -- in case of templating errors.
- warpforge-error-catalog-invalid -- in case the catalog data is invalid.
- warpforge-error-catalog-parse -- in case the catalog data failed to parse entirely.
- warpforge-error-serialization -- in case the replay plot serialization fails
func (SiteConfig) CatalogModuleAndChildrenToHtml ¶
func (cfg SiteConfig) CatalogModuleAndChildrenToHtml(catMod wfapi.CatalogModule) error
CatalogModuleAndChildrenToHtml performs CatalogModuleToHtml, and also procedes to invoke the html'ing of all releases within.
Errors:
- warpforge-error-io -- in case of errors writing out the new html content.
- warpforge-error-internal -- in case of templating errors.
- warpforge-error-catalog-invalid -- in case the catalog data is invalid.
- warpforge-error-catalog-parse -- in case the catalog data failed to parse entirely.
- warpforge-error-serialization -- in case the replay plot serialization fails
func (SiteConfig) CatalogModuleToHtml ¶
func (cfg SiteConfig) CatalogModuleToHtml(catMod wfapi.CatalogModule) error
CatalogModuleToHtml generates a page for a module which enumerates and links to all the releases within it, as well as enumerates all the metadata attached to the catalog module.
Errors:
- warpforge-error-io -- in case of errors writing out the new html content.
- warpforge-error-internal -- in case of templating errors.
func (SiteConfig) CatalogToHtml ¶
func (cfg SiteConfig) CatalogToHtml() error
CatalogToHtml generates a root page that links to all the modules.
This function has no parameters because it uses the DAB in the SiteConfig entirely.
Errors:
- warpforge-error-io -- in case of errors writing out the new html content.
- warpforge-error-internal -- in case of templating errors.
func (SiteConfig) ReleaseToHtml ¶
func (cfg SiteConfig) ReleaseToHtml(catMod wfapi.CatalogModule, rel wfapi.CatalogRelease) error
ReleaseToHtml generates a page for a release within a catalog module which enumerates all the items within it, as well as enumerates all the metadata attached to the release.
Possible but not-yet-implemented future features of this output might include: linking better to metadata that references other documents (such as Replays); links to neighboring (e.g. forward and previous) releases; etc.
Errors:
- warpforge-error-io -- in case of errors writing out the new html content.
- warpforge-error-internal -- in case of templating errors.
func (SiteConfig) ReplayToHtml ¶
func (cfg SiteConfig) ReplayToHtml(catMod wfapi.CatalogModule, rel wfapi.CatalogRelease, replayPlot wfapi.Plot) error
ReplayToHtml generates a page for a replay within a release.
Errors:
- warpforge-error-io -- in case of errors writing out the new html content.
- warpforge-error-internal -- in case of templating errors.
- warpforge-error-serialization -- in case serializing plot fails