docs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Display symbols.
	CheckMark = "✅"
	CrossMark = "❌"
	EmDash    = "—"

	// Common values.
	Yes  = "Yes"
	No   = "No"
	NA   = "N/A"
	Free = "Free"
)

Common display constants used across documentation.

Variables

This section is empty.

Functions

func GetLatestModel

func GetLatestModel(provider *catalogs.Provider) string

GetLatestModel returns the "latest" model from a provider in a deterministic way It picks the model with the lexicographically last ID (often newest versions have higher IDs).

func SortedModels

func SortedModels(models map[string]catalogs.Model) []*catalogs.Model

SortedModels converts a map of models to a sorted slice for deterministic iteration.

Types

type Breadcrumb struct {
	Label string
	Path  string
}

Breadcrumb represents a single breadcrumb navigation item.

type FrontMatter

type FrontMatter struct {
	Title       string
	Description string
	Weight      int
	Author      string
	Draft       bool
	Menu        *MenuConfig
}

FrontMatter represents Hugo front matter.

type FrontMatterOption

type FrontMatterOption func(*FrontMatter)

FrontMatterOption is a functional option for front matter.

func WithAuthor

func WithAuthor(author string) FrontMatterOption

WithAuthor adds an author to the front matter.

func WithDescription

func WithDescription(desc string) FrontMatterOption

WithDescription adds a description to the front matter.

func WithDraft

func WithDraft() FrontMatterOption

WithDraft marks the document as draft.

func WithMenu

func WithMenu(menuType string, weight int) FrontMatterOption

WithMenu adds menu configuration to the front matter.

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator handles documentation generation.

func New

func New(opts ...Option) *Generator

New creates a new documentation generator.

func (*Generator) Generate

func (g *Generator) Generate(_ context.Context, catalog catalogs.Reader) error

Generate generates all documentation for the catalog.

type LogoCopier

type LogoCopier struct {
	// contains filtered or unexported fields
}

LogoCopier handles copying logos from embedded resources.

func NewLogoCopier

func NewLogoCopier(embedFS embed.FS, sourceDir, targetDir string) *LogoCopier

NewLogoCopier creates a new logo copier.

func (*LogoCopier) CopyAllLogos

func (lc *LogoCopier) CopyAllLogos() error

CopyAllLogos copies all logos from embedded resources.

func (*LogoCopier) CopyAuthorLogos

func (lc *LogoCopier) CopyAuthorLogos(authors []*catalogs.Author) error

CopyAuthorLogos copies all author logos to the documentation directory.

func (*LogoCopier) CopyProviderLogos

func (lc *LogoCopier) CopyProviderLogos(providers []*catalogs.Provider) error

CopyProviderLogos copies all provider logos to the documentation directory.

type Markdown

type Markdown struct {
	// contains filtered or unexported fields
}

Markdown wraps the markdown package to provide Hugo-specific functionality.

func NewMarkdown

func NewMarkdown(w io.Writer) *Markdown

NewMarkdown creates a new markdown builder.

func NewMarkdownBuffer

func NewMarkdownBuffer() *Markdown

NewMarkdownBuffer creates a new markdown builder with internal buffer.

func (*Markdown) Alert

func (m *Markdown) Alert(alertType string, text string) *Markdown

Alert adds a GitHub-style alert.

func (*Markdown) Badge

func (m *Markdown) Badge(label, message, color string) *Markdown

Badge adds a badge with custom text and color.

func (*Markdown) Blockquote

func (m *Markdown) Blockquote(text string) *Markdown

Blockquote adds a blockquote.

func (*Markdown) Bold

func (m *Markdown) Bold(text string) *Markdown

Bold adds bold text.

func (m *Markdown) BoldLink(text, url string) *Markdown

BoldLink creates a bold link: **[text](url)**.

func (*Markdown) BooleanCheck

func (m *Markdown) BooleanCheck(value bool) *Markdown

BooleanCheck adds a checkmark or X based on boolean value.

func (*Markdown) Build

func (m *Markdown) Build() error

Build finalizes the markdown document.

func (*Markdown) BulletList

func (m *Markdown) BulletList(items ...string) *Markdown

BulletList adds a bullet list.

func (*Markdown) CheckboxList

func (m *Markdown) CheckboxList(items []struct {
	Text    string
	Checked bool
}) *Markdown

CheckboxList adds a checkbox list.

func (*Markdown) Code

func (m *Markdown) Code(code string) *Markdown

Code adds inline code.

func (*Markdown) CodeBlock

func (m *Markdown) CodeBlock(syntax, code string) *Markdown

CodeBlock adds a code block with syntax highlighting.

func (*Markdown) CodeInline

func (m *Markdown) CodeInline(text string) *Markdown

CodeInline adds inline code.

func (*Markdown) ComparisonTable

func (m *Markdown) ComparisonTable(headers []string, rows [][]any) *Markdown

ComparisonTable creates a comparison table with provider logos.

func (*Markdown) ConditionalSection

func (m *Markdown) ConditionalSection(condition bool, f func(*Markdown)) *Markdown

ConditionalSection adds content only if condition is true.

func (*Markdown) CountText

func (m *Markdown) CountText(count int, singular, plural string) *Markdown

CountText adds formatted count text (e.g., "5 models").

func (*Markdown) Details

func (m *Markdown) Details(summary, content string) *Markdown

Details adds a collapsible details section (HTML in markdown).

func (*Markdown) FeatureTable

func (m *Markdown) FeatureTable(headers []string, rows [][]bool) *Markdown

FeatureTable creates a table with checkmarks/crosses for features.

func (*Markdown) FormatCurrency

func (m *Markdown) FormatCurrency(value float64, currency string) *Markdown

FormatCurrency formats a currency value with symbol.

func (*Markdown) FormatModelID

func (m *Markdown) FormatModelID(id string) *Markdown

FormatModelID formats a model ID with code style.

func (*Markdown) H1

func (m *Markdown) H1(text string) *Markdown

H1 creates a level 1 header.

func (*Markdown) H2

func (m *Markdown) H2(text string) *Markdown

H2 creates a level 2 header.

func (*Markdown) H3

func (m *Markdown) H3(text string) *Markdown

H3 creates a level 3 header.

func (*Markdown) H4

func (m *Markdown) H4(text string) *Markdown

H4 creates a level 4 header.

func (*Markdown) HorizontalRule

func (m *Markdown) HorizontalRule() *Markdown

HorizontalRule adds a horizontal rule.

func (*Markdown) HugoFrontMatter

func (m *Markdown) HugoFrontMatter(title string, weight int, opts ...FrontMatterOption) *Markdown

HugoFrontMatter adds Hugo front matter to the document.

func (*Markdown) Image

func (m *Markdown) Image(alt, url string) *Markdown

Image adds an image with optional styling.

func (*Markdown) ImageWithStyle

func (m *Markdown) ImageWithStyle(alt, url string, width, height int) *Markdown

ImageWithStyle adds an image with inline CSS styling for Hugo.

func (*Markdown) Italic

func (m *Markdown) Italic(text string) *Markdown

Italic adds italic text.

func (*Markdown) JoinList

func (m *Markdown) JoinList(items []string, separator string) *Markdown

JoinList joins items with a separator.

func (*Markdown) LF

func (m *Markdown) LF() *Markdown

LF adds a line feed.

func (m *Markdown) Link(text, url string) *Markdown

Link adds a markdown link.

func (*Markdown) NavigationFooter

func (m *Markdown) NavigationFooter(prevText, prevURL, nextText, nextURL, upText, upURL string) *Markdown

NavigationFooter adds a standard navigation footer for Hugo docs.

func (*Markdown) OrderedList

func (m *Markdown) OrderedList(items ...string) *Markdown

OrderedList adds an ordered list.

func (*Markdown) PlainText

func (m *Markdown) PlainText(text string) *Markdown

PlainText adds plain text.

func (*Markdown) PlainTextf

func (m *Markdown) PlainTextf(format string, args ...any) *Markdown

PlainTextf adds formatted plain text.

func (*Markdown) RawHTML

func (m *Markdown) RawHTML(html string) *Markdown

RawHTML adds raw HTML (useful for Hugo shortcodes or custom elements).

func (*Markdown) String

func (m *Markdown) String() string

String returns the buffered content.

func (*Markdown) Table

func (m *Markdown) Table(table md.TableSet) *Markdown

Table adds a markdown table.

func (*Markdown) TruncateText

func (m *Markdown) TruncateText(text string, maxLen int) *Markdown

TruncateText adds text that may be truncated with ellipsis.

func (*Markdown) Writer

func (m *Markdown) Writer() io.Writer

Writer returns the underlying writer.

type MenuConfig struct {
	Before *MenuEntry
	After  *MenuEntry
}

MenuConfig represents menu configuration in Hugo front matter.

type MenuEntry struct {
	Weight int
}

MenuEntry represents a single menu entry.

type NavigationContext struct {
	Depth       int    // How many levels deep from root
	CurrentPath string // Current page path
	PageType    string // Type of page: "provider", "author", "model", "catalog"
}

NavigationContext provides context for generating navigation elements.

type NavigationLink struct {
	Label       string
	Path        string
	Description string
}

NavigationLink represents a navigation link with optional description.

type Option

type Option func(*Generator)

Option is a functional option for configuring the Generator.

func WithOutputDir

func WithOutputDir(dir string) Option

WithOutputDir sets the output directory for generated documentation.

func WithVerbose

func WithVerbose(verbose bool) Option

WithVerbose enables verbose output.

Jump to

Keyboard shortcuts

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