transformer

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package transformer provides content transformation for different output formats. It centralizes the logic for rewriting asset paths and handling frontmatter, ensuring consistent behavior between docgen aggregate and docgen watch commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AstroTransformer

type AstroTransformer struct{}

AstroTransformer handles content transformations for Astro

func NewAstroTransformer

func NewAstroTransformer() *AstroTransformer

NewAstroTransformer creates a new Astro transformer

func (*AstroTransformer) TransformStandardDoc

func (t *AstroTransformer) TransformStandardDoc(content []byte, opts TransformOptions) []byte

TransformStandardDoc applies transformations for standard package documentation: - Rewrites relative asset paths to absolute /docs/{pkg}/... paths - Replaces any existing frontmatter with a new one

func (*AstroTransformer) TransformWebsiteSection

func (t *AstroTransformer) TransformWebsiteSection(content []byte, opts TransformOptions) []byte

TransformWebsiteSection applies transformations for website sections (overview, concepts): - Rewrites relative asset paths to absolute /docs/{section}/... paths - Augments existing frontmatter (preserves manual fields) with category and package

type TransformOptions

type TransformOptions struct {
	// For standard package documentation
	PackageName string
	Title       string
	Description string
	Version     string
	Category    string
	Order       int

	// For website sections (overview, concepts)
	SectionName string
}

TransformOptions holds metadata for content transformation

Jump to

Keyboard shortcuts

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