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:
@@ -42,8 +42,12 @@ const Answer = 42
|
||||
func init() {
|
||||
simple.ModuleRegister(ModuleName, "answer", &simple.Scaffold{
|
||||
T: types.NewType("func() int"),
|
||||
F: func(context.Context, []types.Value) (types.Value, error) {
|
||||
return &types.IntValue{V: Answer}, nil
|
||||
},
|
||||
F: TheAnswerToLifeTheUniverseAndEverything,
|
||||
})
|
||||
}
|
||||
|
||||
// TheAnswerToLifeTheUniverseAndEverything returns the Answer to Life, the
|
||||
// Universe and Everything.
|
||||
func TheAnswerToLifeTheUniverseAndEverything(context.Context, []types.Value) (types.Value, error) {
|
||||
return &types.IntValue{V: Answer}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user