cli, docs: Add a docs command for doc generation

This took a lot longer than it looks to get right. It's not perfect, but
it now reliably generates documentation which we can put into gohugo.
This commit is contained in:
James Shubin
2024-11-22 14:20:16 -05:00
parent 7b45f94bb0
commit a600e11100
27 changed files with 1379 additions and 41 deletions

View File

@@ -34,6 +34,7 @@ import (
"fmt"
"strings"
docsUtil "github.com/purpleidea/mgmt/docs/util"
"github.com/purpleidea/mgmt/engine"
"github.com/purpleidea/mgmt/engine/local"
"github.com/purpleidea/mgmt/lang/types"
@@ -279,6 +280,16 @@ type DataFunc interface {
SetData(*FuncData)
}
// MetadataFunc is a function that can return some extraneous information about
// itself, which is usually used for documentation generation and so on.
type MetadataFunc interface {
Func // implement everything in Func but add the additional requirements
// Metadata returns some metadata about the func. It can be called at
// any time, and doesn't require you run Init() or anything else first.
GetMetadata() *docsUtil.Metadata
}
// FuncEdge links an output vertex (value) to an input vertex with a named
// argument.
type FuncEdge struct {