diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-09-08 20:11:01 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-09-08 21:57:27 +0200 |
commit | 07fcce6e631dfc07517e0cc1a2918954cd647f5f (patch) | |
tree | a911fcc740933a57d562b02749870fe8ffc0b8ca /compiler/docgen.nim | |
parent | 3e87ef35faa92333d6c78af1109d5da0cf0fc9c7 (diff) | |
download | Nim-07fcce6e631dfc07517e0cc1a2918954cd647f5f.tar.gz |
docgen: different attachedType generation
Diffstat (limited to 'compiler/docgen.nim')
-rw-r--r-- | compiler/docgen.nim | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 9c72d5a84..af940db00 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -440,11 +440,6 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) = dispA(result, "<span class=\"Other\">$1</span>", "\\spanOther{$1}", [rope(esc(d.target, literal))]) - if k in routineKinds and nameNode.kind == nkSym: - let att = attachToType(d, nameNode.sym) - if att != nil: - dispA(result, """<span class="attachedType" style="visibility:hidden">$1</span>""", "", - [rope esc(d.target, att.name.s)]) inc(d.id) let plainNameRope = rope(xmltree.escape(plainName.strip)) @@ -476,12 +471,18 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) = "itemSymOrID", "itemSymEnc", "itemSymOrIDEnc", "seeSrc"], [nameRope, result, comm, itemIDRope, plainNameRope, plainSymbolRope, symbolOrIdRope, plainSymbolEncRope, symbolOrIdEncRope, seeSrcRope])) + + var attype: Rope + if k in routineKinds and nameNode.kind == nkSym: + let att = attachToType(d, nameNode.sym) + if att != nil: + attype = rope esc(d.target, att.name.s) add(d.toc[k], ropeFormatNamedVars(getConfigVar("doc.item.toc"), ["name", "header", "desc", "itemID", "header_plain", "itemSym", - "itemSymOrID", "itemSymEnc", "itemSymOrIDEnc"], + "itemSymOrID", "itemSymEnc", "itemSymOrIDEnc", "attype"], [rope(getName(d, nameNode, d.splitAfter)), result, comm, itemIDRope, plainNameRope, plainSymbolRope, symbolOrIdRope, - plainSymbolEncRope, symbolOrIdEncRope])) + plainSymbolEncRope, symbolOrIdEncRope, attype])) # Ironically for types the complexSymbol is *cleaner* than the plainName # because it doesn't include object fields or documentation comments. So we |