docs

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Overview

Package docs provides documentation generation, external docs fetching, and doc updating types.

Public types: DocGenerator, DocSection, ProjectDoc, PackageDoc, FunctionDoc, ParamDoc, TypeDoc, FieldDoc, DocSource, DocResult, ExternalDocs, DocUpdate, DocUpdater.

Public functions: NewDocGenerator, NewExternalDocs, NewDocUpdater, RenderMarkdown, RenderHTML, GenerateREADME.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateREADME

func GenerateREADME(doc *ProjectDoc) string

func RenderHTML

func RenderHTML(doc *ProjectDoc) string

func RenderMarkdown

func RenderMarkdown(doc *ProjectDoc) string

Types

type DocGenerator

type DocGenerator struct {
	ProjectDir     string
	OutputFormat   string
	IncludePrivate bool
	MaxDepth       int
}

func NewDocGenerator

func NewDocGenerator(projectDir string) *DocGenerator

func (*DocGenerator) Generate

func (dg *DocGenerator) Generate() (*ProjectDoc, error)

func (*DocGenerator) InferDescription

func (dg *DocGenerator) InferDescription(projectDir string) string

type DocResult

type DocResult struct {
	Source    string
	Title     string
	Content   string
	URL       string
	Relevance float64
	Tokens    int
}

type DocSection

type DocSection struct {
	Title    string
	Content  string
	Children []DocSection
	Level    int
}

type DocSource

type DocSource struct {
	Name     string
	BaseURL  string
	Packages []string
	Language string
	Priority int
}

type DocUpdate

type DocUpdate struct {
	File   string
	Line   int
	OldDoc string
	NewDoc string
	Symbol string
	Reason string
}

type DocUpdater

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

func NewDocUpdater

func NewDocUpdater() *DocUpdater

func (*DocUpdater) ApplyUpdates

func (du *DocUpdater) ApplyUpdates(updates []DocUpdate, content string) string

func (*DocUpdater) DetectStaleDocumentation

func (du *DocUpdater) DetectStaleDocumentation(file, oldContent, newContent string) []DocUpdate

func (*DocUpdater) FormatUpdates

func (du *DocUpdater) FormatUpdates(updates []DocUpdate) string

func (*DocUpdater) GenerateDocUpdate

func (du *DocUpdater) GenerateDocUpdate(funcName, signature, oldDoc string) string

func (*DocUpdater) ScanProjectForStaleDocs

func (du *DocUpdater) ScanProjectForStaleDocs(projectDir string) []DocUpdate

type ExternalDocs

type ExternalDocs struct {
	Sources   []DocSource
	Cache     map[string]*DocResult
	MaxTokens int
	// contains filtered or unexported fields
}

func NewExternalDocs

func NewExternalDocs() *ExternalDocs

func (*ExternalDocs) BuildDocContext

func (ed *ExternalDocs) BuildDocContext(results []DocResult, budget int) string

func (*ExternalDocs) ExtractPackageRefs

func (ed *ExternalDocs) ExtractPackageRefs(text string) []string

func (*ExternalDocs) FindRelevant

func (ed *ExternalDocs) FindRelevant(task string, language string, limit int) []DocResult

func (*ExternalDocs) FormatResults

func (ed *ExternalDocs) FormatResults(results []DocResult) string

func (*ExternalDocs) RegisterSource

func (ed *ExternalDocs) RegisterSource(source DocSource)

type FieldDoc

type FieldDoc struct {
	Name string
	Type string
	Tag  string
	Desc string
}

type FunctionDoc

type FunctionDoc struct {
	Name        string
	Signature   string
	Description string
	Parameters  []ParamDoc
	Returns     string
	Example     string
	Exported    bool
}

type PackageDoc

type PackageDoc struct {
	Name        string
	Path        string
	Description string
	Functions   []FunctionDoc
	Types       []TypeDoc
	FileCount   int
}

type ParamDoc

type ParamDoc struct {
	Name string
	Type string
	Desc string
}

type ProjectDoc

type ProjectDoc struct {
	Name         string
	Description  string
	Packages     []PackageDoc
	Architecture string
	QuickStart   string
	GeneratedAt  time.Time
}

type TypeDoc

type TypeDoc struct {
	Name        string
	Kind        string
	Fields      []FieldDoc
	Methods     []FunctionDoc
	Description string
}

Jump to

Keyboard shortcuts

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