Expose template options

This commit is contained in:
2026-05-27 08:26:14 +02:00
parent 59c8e407e9
commit 89508b3c03
7 changed files with 236 additions and 0 deletions
+25
View File
@@ -1304,6 +1304,31 @@ func (p *wikiExprParser) callHelper(name string, args []any) (any, error) {
return nil, fmt.Errorf("alignments expects 1 argument")
}
return p.ctx.formatWikiTemplateAlignments(args[0])
case "yes_no":
if len(args) != 1 {
return nil, fmt.Errorf("yes_no expects 1 argument")
}
return yesNoValue(stringifyWikiTableValue(args[0])), nil
case "text":
if len(args) != 1 {
return nil, fmt.Errorf("text expects 1 argument")
}
return p.ctx.resolveTextValue(args[0], nil), nil
case "ref":
if len(args) != 2 {
return nil, fmt.Errorf("ref expects 2 arguments")
}
return p.ctx.renderReference(args[0], p.ctx.wikiIDMapForDataset(stringifyWikiTableValue(args[1])), p.ctx.wikiNameResolverForDataset(stringifyWikiTableValue(args[1]))), nil
case "feat_prerequisites":
if len(args) != 0 {
return nil, fmt.Errorf("feat_prerequisites expects 0 arguments")
}
return p.ctx.renderFeatPrerequisites(p.renderCtx.Page.Row), nil
case "required_feats":
if len(args) != 0 {
return nil, fmt.Errorf("required_feats expects 0 arguments")
}
return p.ctx.renderReferenceList(p.ctx.wikiReqFeats(p.renderCtx.Page.Row)), nil
case "ability_adjustments":
if len(args) != 0 {
return nil, fmt.Errorf("ability_adjustments expects 0 arguments")