This commit is contained in:
Araq 2017-11-28 22:27:43 +01:00
commit cb8dd0252f

View file

@ -553,12 +553,24 @@ proc genJsonItem(d: PDoc, n, nameNode: PNode, k: TSymKind): JsonNode =
proc checkForFalse(n: PNode): bool = proc checkForFalse(n: PNode): bool =
result = n.kind == nkIdent and cmpIgnoreStyle(n.ident.s, "false") == 0 result = n.kind == nkIdent and cmpIgnoreStyle(n.ident.s, "false") == 0
proc traceDeps(d: PDoc, n: PNode) = proc traceDeps(d: PDoc, it: PNode) =
const k = skModule const k = skModule
if d.section[k] != nil: add(d.section[k], ", ")
dispA(d.section[k], if it.kind == nkInfix and it.len == 3 and it[2].kind == nkBracket:
"<a class=\"reference external\" href=\"$1.html\">$1</a>", let sep = it[0]
"$1", [rope(getModuleName(n))]) let dir = it[1]
let a = newNodeI(nkInfix, it.info)
a.add sep
a.add dir
a.add sep # dummy entry, replaced in the loop
for x in it[2]:
a.sons[2] = x
traceDeps(d, a)
else:
if d.section[k] != nil: add(d.section[k], ", ")
dispA(d.section[k],
"<a class=\"reference external\" href=\"$1.html\">$1</a>",
"$1", [rope(getModuleName(it))])
proc generateDoc*(d: PDoc, n: PNode) = proc generateDoc*(d: PDoc, n: PNode) =
case n.kind case n.kind