docgen

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package docgen provides automated documentation generation from action metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionDefinition

type ActionDefinition struct {
	Type                 string                    `json:"type"`
	Description          string                    `json:"description"`
	Properties           map[string]PropertySchema `json:"properties"`
	Required             []string                  `json:"required"`
	AdditionalProperties interface{}               `json:"additionalProperties"`
	Category             string                    `json:"x-category"`
	Version              string                    `json:"x-version"`
}

ActionDefinition represents an action in the schema.

type ActionProperties

type ActionProperties struct {
	Name        string
	Description string
	Properties  []PropertyDef
	Category    string
	Version     string
}

ActionProperties represents parsed action properties from schema.

type Generator

type Generator struct {
	Version   string
	Timestamp time.Time
}

Generator generates documentation from action metadata.

func NewGenerator

func NewGenerator(version string) *Generator

NewGenerator creates a new documentation generator.

func (*Generator) GenerateSection

func (g *Generator) GenerateSection(section string, w io.Writer, presetsDir string) error

GenerateSection generates a specific documentation section. presetsDir is optional and only used for preset-examples section.

type PropertyDef

type PropertyDef struct {
	Name        string
	Type        string
	Description string
	Required    bool
	Default     string
	Enum        []string
}

PropertyDef represents a single property definition.

type PropertySchema

type PropertySchema struct {
	Type        interface{}               `json:"type"` // Can be string or array
	Description string                    `json:"description"`
	Default     interface{}               `json:"default"`
	Enum        []interface{}             `json:"enum"`
	Ref         string                    `json:"$ref"`
	Properties  map[string]PropertySchema `json:"properties"`
	Items       *PropertySchema           `json:"items"`
}

PropertySchema represents a property in the schema.

type SchemaDefinition

type SchemaDefinition struct {
	Definitions map[string]ActionDefinition `json:"definitions"`
}

SchemaDefinition represents the JSON schema structure.

Jump to

Keyboard shortcuts

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