docgen

command
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

docgen generates internal/handler/docs_gen.go containing Markdown documentation for Caddyfile directives, extracted from Caddy's source code.

It handles two patterns used in Caddy:

  1. Types with an UnmarshalCaddyfile method — the method doc comment contains the directive's Caddyfile syntax.
  2. Standalone functions registered via httpcaddyfile.RegisterDirective or RegisterHandlerDirective — the function doc comment contains the syntax.

Only doc comments that contain a fenced code example (tab-indented lines in Go doc convention) are kept; plain-text-only docs are skipped.

Run via go generate from the project root:

go generate ./internal/handler/

Jump to

Keyboard shortcuts

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