generator

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Overview

Package generator provides functions to generate manifest.json and llms.txt files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteLLMsFull

func WriteLLMsFull(path string, docs []*Document, project config.ProjectConfig, dryRun bool) error

WriteLLMsFull generates the complete document index file.

func WriteLLMsTxt

func WriteLLMsTxt(path string, docs []*Document, cfg *config.Config, dryRun bool) error

WriteLLMsTxt generates or updates the root llms.txt navigation file. If the file already exists, it is not overwritten unless force is true.

func WriteManifest

func WriteManifest(path string, m *Manifest, dryRun bool) error

WriteManifest writes the manifest to disk.

func WriteTags

func WriteTags(path string, tags *TagsFile, dryRun bool) error

WriteTags writes the tags file to disk.

Types

type Document

type Document struct {
	Path        string
	Frontmatter *docparser.Frontmatter
	Section     string // From SUMMARY.md structure
}

Document represents a processed documentation file.

type Manifest

type Manifest struct {
	KnowledgeBase map[string]any   `json:"knowledgeBase"`
	Documents     []map[string]any `json:"documents"`
	Sections      map[string]any   `json:"sections"`
	Metadata      map[string]any   `json:"metadata"`
}

Manifest represents the complete manifest.json structure.

func GenerateManifest

func GenerateManifest(docs []*Document, project config.ProjectConfig) *Manifest

GenerateManifest creates a manifest from processed documents.

type TagInfo

type TagInfo struct {
	Count     int      `json:"count"`
	Documents []string `json:"documents"`
}

TagInfo contains information about a single tag.

type TagsFile

type TagsFile struct {
	Tags      map[string]*TagInfo `json:"tags"`
	TotalTags int                 `json:"totalTags"`
	TopTags   []string            `json:"topTags"`
}

TagsFile represents the aggregated tags output.

func GenerateTags

func GenerateTags(docs []*Document) *TagsFile

GenerateTags creates an aggregated tags structure from documents.

Jump to

Keyboard shortcuts

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