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

@@ -36,6 +36,7 @@ import (
"fmt"
"math"
docsUtil "github.com/purpleidea/mgmt/docs/util"
"github.com/purpleidea/mgmt/lang/funcs"
"github.com/purpleidea/mgmt/lang/funcs/simple"
"github.com/purpleidea/mgmt/lang/interfaces"
@@ -468,6 +469,8 @@ func LookupOperator(operator string, size int) (*types.Type, error) {
// OperatorFunc is an operator function that performs an operation on N values.
// XXX: Can we wrap SimpleFunc instead of having the boilerplate here ourselves?
type OperatorFunc struct {
*docsUtil.Metadata
Type *types.Type // Kind == Function, including operator arg
init *interfaces.Init