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 ¶
- func GenerateREADME(doc *ProjectDoc) string
- func RenderHTML(doc *ProjectDoc) string
- func RenderMarkdown(doc *ProjectDoc) string
- type DocGenerator
- type DocResult
- type DocSection
- type DocSource
- type DocUpdate
- type DocUpdater
- func (du *DocUpdater) ApplyUpdates(updates []DocUpdate, content string) string
- func (du *DocUpdater) DetectStaleDocumentation(file, oldContent, newContent string) []DocUpdate
- func (du *DocUpdater) FormatUpdates(updates []DocUpdate) string
- func (du *DocUpdater) GenerateDocUpdate(funcName, signature, oldDoc string) string
- func (du *DocUpdater) ScanProjectForStaleDocs(projectDir string) []DocUpdate
- type ExternalDocs
- func (ed *ExternalDocs) BuildDocContext(results []DocResult, budget int) string
- func (ed *ExternalDocs) ExtractPackageRefs(text string) []string
- func (ed *ExternalDocs) FindRelevant(task string, language string, limit int) []DocResult
- func (ed *ExternalDocs) FormatResults(results []DocResult) string
- func (ed *ExternalDocs) RegisterSource(source DocSource)
- type FieldDoc
- type FunctionDoc
- type PackageDoc
- type ParamDoc
- type ProjectDoc
- type TypeDoc
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 ¶
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 DocSection ¶
type DocSection struct {
Title string
Content string
Children []DocSection
Level int
}
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 FunctionDoc ¶
type PackageDoc ¶
type ProjectDoc ¶
Click to show internal directories.
Click to hide internal directories.