magicdocs

package
v0.1.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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMarkdown

func GenerateMarkdown(entries []DocEntry) string

GenerateMarkdown generates markdown documentation.

Types

type DocEntry

type DocEntry struct {
	Package string `json:"package"`
	Name    string `json:"name"`
	Type    string `json:"type"` // function, type, method, variable
	Doc     string `json:"doc"`
	File    string `json:"file"`
	Line    int    `json:"line"`
}

DocEntry represents a generated documentation entry.

func Extract

func Extract(dir string) ([]DocEntry, error)

Extract extracts documentation from Go source files.

type MagicDocFile

type MagicDocFile struct {
	Path        string
	Title       string
	LastUpdated time.Time
}

MagicDocFile represents a file containing auto-update markers.

func ScanForMagicDocs

func ScanForMagicDocs(dir string) []MagicDocFile

ScanForMagicDocs finds files containing "# MAGIC DOC:" markers in the given directory tree. It skips hidden directories and common non-source paths.

func (*MagicDocFile) GenerateUpdatePrompt

func (m *MagicDocFile) GenerateUpdatePrompt() string

GenerateUpdatePrompt creates the prompt for the LLM to regenerate the doc.

func (*MagicDocFile) NeedsUpdate

func (m *MagicDocFile) NeedsUpdate() bool

NeedsUpdate returns true if the magic doc is stale (>24h since last update).

Jump to

Keyboard shortcuts

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