contentbundle

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = "pinax.content_bundle.v1"

Variables

This section is empty.

Functions

func Dedupe

func Dedupe(values []string) []string

func SafeSlug

func SafeSlug(value string) string

func StableID

func StableID(prefix, raw string) string

func Validate

func Validate(bundle Bundle) error

Types

type Bundle

type Bundle struct {
	SchemaVersion string `json:"schema_version" yaml:"schema_version"`
	ID            string `json:"id" yaml:"id"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Source        Source `json:"source,omitempty" yaml:"source,omitempty"`
	Items         []Item `json:"items" yaml:"items"`
}

func Load

func Load(content []byte) (Bundle, error)

type Issue

type Issue struct {
	ItemID  string `json:"item_id,omitempty"`
	Code    string `json:"code"`
	Field   string `json:"field,omitempty"`
	Message string `json:"message"`
}

type Item

type Item struct {
	ID         string   `json:"id" yaml:"id"`
	Title      string   `json:"title,omitempty" yaml:"title,omitempty"`
	Category   string   `json:"category,omitempty" yaml:"category,omitempty"`
	Language   string   `json:"language,omitempty" yaml:"language,omitempty"`
	Prompt     string   `json:"prompt,omitempty" yaml:"prompt,omitempty"`
	SourceURL  string   `json:"source_url,omitempty" yaml:"source_url,omitempty"`
	Featured   bool     `json:"featured,omitempty" yaml:"featured,omitempty"`
	Tags       []string `json:"tags,omitempty" yaml:"tags,omitempty"`
	Techniques []string `json:"techniques,omitempty" yaml:"techniques,omitempty"`
	Styles     []string `json:"styles,omitempty" yaml:"styles,omitempty"`
	Subjects   []string `json:"subjects,omitempty" yaml:"subjects,omitempty"`
}

type Source

type Source struct {
	ID  string `json:"id,omitempty" yaml:"id,omitempty"`
	URL string `json:"url,omitempty" yaml:"url,omitempty"`
}

type Stats

type Stats struct {
	Items              int            `json:"items"`
	CompleteItems      int            `json:"complete_items"`
	MissingPromptItems int            `json:"missing_prompt_items"`
	FeaturedItems      int            `json:"featured_items"`
	Languages          map[string]int `json:"languages,omitempty"`
	Categories         map[string]int `json:"categories,omitempty"`
	Issues             []Issue        `json:"issues,omitempty"`
}

func Analyze

func Analyze(bundle Bundle) Stats

Jump to

Keyboard shortcuts

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