Skip to content

Commit

Permalink
[improve] reference handling, fixes #39
Browse files Browse the repository at this point in the history
Doc-comments can now contain references which are not treated as cross-references, e.g., references to other parts of the document.
  • Loading branch information
Mc-Zen committed Dec 15, 2024
1 parent ef7ccf9 commit 63a2f77
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/show-module.typ
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,14 @@
return raw(target)
}
let defs = def-state.final()
if defs.at(target, default: none) == 1 {

let base = target
if "." in base { base = base.split(".").first() }
let target-def = defs.at(target, default: none)
let base-def = defs.at(base, default: none)
if target-def == none and base-def == none { return it }

if target-def == 1 {
target += "()"
}
(eval-scope.tidy.show-reference)(label(label-prefix + target), target)
Expand Down

0 comments on commit 63a2f77

Please sign in to comment.