Skip to content

Commit

Permalink
[fix] info access in templates when old-syntax: true
Browse files Browse the repository at this point in the history
  • Loading branch information
Mc-Zen committed Dec 11, 2024
1 parent f92aa3a commit 1e3cd85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/styles/default.typ
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@
if not inline-args { "\n " }
let items = ()
let args = fn.args
for (name, description) in fn.args {
for (name, info) in fn.args {
if style-args.omit-private-parameters and name.starts-with("_") {
continue
}
let types
if "types" in description {
types = ": " + description.types.map(x => show-type(x, style-args: style-args)).join(" ")
if "types" in info {
types = ": " + info.types.map(x => show-type(x, style-args: style-args)).join(" ")
}
if style-args.enable-cross-references and not (description.description == "" and style-args.omit-empty-param-descriptions) {
if style-args.enable-cross-references and not (info.at("description", default: "") == "" and style-args.omit-empty-param-descriptions) {
name = link(label(style-args.label-prefix + fn.name + "." + name.trim(".")), name)
}
items.push(name + types)
Expand Down
2 changes: 1 addition & 1 deletion src/styles/minimal.typ
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
if "types" in info {
types = ": " + info.types.map(x => show-type(x)).join(" ")
}
if style-args.enable-cross-references and not (info.description == "" and style-args.omit-empty-param-descriptions) {
if style-args.enable-cross-references and not (info.at("description", default: "") == "" and style-args.omit-empty-param-descriptions) {
name = link(label(style-args.label-prefix + fn.name + "." + name.trim(".")), name)
}
items.push(box(name + types))
Expand Down

0 comments on commit 1e3cd85

Please sign in to comment.