mirror of
https://github.com/janet-lang/janet
synced 2024-12-25 07:50:27 +00:00
Add anchors in generated docs
This allows us to link to specific functions.
This commit is contained in:
parent
e755f98300
commit
7350bf5dd9
@ -75,6 +75,7 @@
|
||||
:ref ref
|
||||
:source-map sm
|
||||
:doc docstring} env-entry
|
||||
html-key (html-escape key)
|
||||
binding-type (cond
|
||||
macro :macro
|
||||
ref (string :var " (" (type (get ref 0)) ")")
|
||||
@ -82,7 +83,7 @@
|
||||
source-ref (if-let [[path start end] sm]
|
||||
(string "<span class=\"source-map\">" path " (" start ":" end ")</span>")
|
||||
"")]
|
||||
(string "<h2 class=\"binding\">" (html-escape key) "</h2>\n"
|
||||
(string "<h2 class=\"binding\"><a id=\"" key "\">" html-key "</a></h2>\n"
|
||||
"<span class=\"binding-type\">" binding-type "</span>\n"
|
||||
"<p class=\"docstring\">" (trim-lead (html-escape docstring)) "</p>\n"
|
||||
source-ref)))
|
||||
|
Loading…
Reference in New Issue
Block a user