https://github.com/caddyserver/moduledoc
Automated JSON docs generation for Caddy modules
https://github.com/caddyserver/moduledoc
Last synced: about 1 year ago
JSON representation
Automated JSON docs generation for Caddy modules
- Host: GitHub
- URL: https://github.com/caddyserver/moduledoc
- Owner: caddyserver
- License: apache-2.0
- Created: 2020-06-15T16:40:51.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-09-20T18:29:46.000Z (over 3 years ago)
- Last Synced: 2025-04-08T19:35:14.491Z (about 1 year ago)
- Language: Go
- Size: 163 KB
- Stars: 8
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ModuleDoc
=========
[](https://pkg.go.dev/github.com/caddyserver/moduledoc)
This package implements the source analysis core of [Caddy](https://caddyserver.com)'s [module documentation system](https://caddyserver.com/docs/json/). It reads Go code to generate JSON docs -- kind of like godoc, but following JSON tags, and with special integration with Caddy's module architecture.
This package requires Go to be installed on the machine because it uses [the `packages` package](https://pkg.go.dev/golang.org/x/tools/go/packages) as well as running `go` commands directly. Inputs are fully-qualified package and type names, and outputs are JSON-structured type definitions and documentation. A backing data store is required for amortization.
A front-end can then be built to render the results, for example: both https://caddyserver.com/docs/json/ and https://caddyserver.com/docs/modules are powered by this package.
**Author's disclaimer:** This package comes with no guarantees of stability or correctness. The code is very hand-wavy, and I really had no idea what I was doing at the time, but at least it works! (Mostly.) Always refer to actual source code as authoritative documentation as the output of this package is not always perfect.
_(c) 2019 Matthew Holt_