docs: Regen docshelper

This commit is contained in:
Bjørn Erik Pedersen
2023-05-22 17:47:06 +02:00
parent 943ff7f7ce
commit b6e6438f7f
3 changed files with 311 additions and 223 deletions

View File

@@ -170,14 +170,17 @@ func (namespaces TemplateFuncsNamespaces) MarshalJSON() ([]byte, error) {
buf.WriteString("{")
for i, ns := range namespaces {
if i != 0 {
buf.WriteString(",")
}
b, err := ns.toJSON(context.TODO())
if err != nil {
return nil, err
}
buf.Write(b)
if b != nil {
if i != 0 {
buf.WriteString(",")
}
buf.Write(b)
}
}
buf.WriteString("}")
@@ -202,6 +205,11 @@ func (t *TemplateFuncsNamespace) toJSON(ctx context.Context) ([]byte, error) {
if err != nil {
return nil, err
}
if tctx == nil {
// E.g. page.
// We should fix this, but we're going to abandon this construct in a little while.
return nil, nil
}
ctxType := reflect.TypeOf(tctx)
for i := 0; i < ctxType.NumMethod(); i++ {
method := ctxType.Method(i)