generator

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSystemPrompt = `` /* 2316-byte string literal not displayed */

DefaultSystemPrompt provides standard tone and style guidelines for all documentation

View Source
const DocSectionsSystemPrompt = `You are creating a configuration reference document with multiple sections.
Each section represents a different configuration context (e.g., user config, ecosystem config, package config).

**Input Format:**
Each "SECTION" in the input includes:
- Title: The H2 heading to use
- Description: What this configuration context is for
- Properties: Which properties to document and include in the example
- Documentation: The source docs to pull descriptions from

**Output Format (Markdown):**

For EACH section provided, create:

## [Section Title]

[Section Description - one paragraph explaining when/where this config is used]

| Property | Description |
|----------|-------------|
[Table rows for each property listed, with descriptions VERBATIM from the source docs]

` + "```toml" + `
# [Brief comment about this config context]
[Realistic example using ONLY the properties listed for this section]
[Include inline comments with descriptions from the docs]
` + "```" + `

**Rules:**
- Create one H2 section for each input section
- Use exact wording from the docs for descriptions - do not paraphrase
- Each section gets its own TOML example with only that section's properties
- All TOML must be inside fenced code blocks
- No preamble or explanation outside the specified format
---
`
View Source
const SchemaToMarkdownSystemPrompt = `` /* 1468-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateOptions

type GenerateOptions struct {
	Sections []string // List of section names to generate (empty means all)
}

GenerateOptions configures what sections to generate

type Generator

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

Generator handles the documentation generation for a single package.

func New

func New(logger *logrus.Logger) *Generator

func (*Generator) BuildContext

func (g *Generator) BuildContext(packageDir string) error

BuildContext runs cx generate to prepare context for LLM calls

func (*Generator) CallLLM

func (g *Generator) CallLLM(promptContent, model string, genConfig config.GenerationConfig, workDir string) (string, error)

CallLLM makes an LLM request with the given prompt and configuration

func (*Generator) Generate

func (g *Generator) Generate(packageDir string) error

Generate orchestrates an isolated documentation generation process for all sections.

func (*Generator) GenerateWithOptions

func (g *Generator) GenerateWithOptions(packageDir string, opts GenerateOptions) error

GenerateWithOptions orchestrates documentation generation with specific options.

Jump to

Keyboard shortcuts

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