docpost

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Overview

Package docpost transforms raw Cobra-generated markdown into Fumadocs-compatible MDX files with YAML frontmatter. Output is grouped into a nested directory structure by command family so the Fumadocs sidebar collapses the CLI reference. The generated root command page is written as agh.mdx so index.mdx can remain a hand-authored overview.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process(ctx context.Context, srcDir, dstDir string) error

Process reads all agh*.md files from srcDir, transforms them into Fumadocs-compatible MDX, and writes them to dstDir using a nested directory layout: `agh` → agh.mdx, `agh_agent` → agent/index.mdx, `agh_agent_list` → agent/list.mdx, and so on.

The root-level index.mdx and meta.json of dstDir are hand-maintained and never touched by Process. Subdirectory meta.json files are regenerated on each run. Stale files from prior runs are removed before writing.

func TransformMarkdown

func TransformMarkdown(raw, cmdName string) string

TransformMarkdown converts raw Cobra markdown to Fumadocs MDX format. It strips boilerplate, extracts metadata, and prepends YAML frontmatter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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