From 40255f6721154c35a8f66653826928123178f1bb Mon Sep 17 00:00:00 2001 From: Miran Date: Wed, 9 Dec 2020 10:56:28 +0100 Subject: [PATCH] put both funcs and procs under the same section in the documentation (#16301) * both funcs and procs are under the same section in the documentation * update the test --- compiler/docgen.nim | 10 ++---- nimdoc/testproject/expected/testproject.html | 35 +++++++------------- 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 6ee03e292..7b3b62174 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -1045,12 +1045,9 @@ proc generateDoc*(d: PDoc, n, orig: PNode, docFlags: DocFlags = kDefault) = let pragmaNode = findPragma(n, wDeprecated) d.modDeprecationMsg.add(genDeprecationMsg(d, pragmaNode)) of nkCommentStmt: d.modDesc.add(genComment(d, n)) - of nkProcDef: + of nkProcDef, nkFuncDef: when useEffectSystem: documentRaises(d.cache, n) genItemAux(skProc) - of nkFuncDef: - when useEffectSystem: documentRaises(d.cache, n) - genItemAux(skFunc) of nkMethodDef: when useEffectSystem: documentRaises(d.cache, n) genItemAux(skMethod) @@ -1101,12 +1098,9 @@ proc generateJson*(d: PDoc, n: PNode, includeComments: bool = true) = d.add %*{"comment": genComment(d, n)} else: d.modDesc.add(genComment(d, n)) - of nkProcDef: + of nkProcDef, nkFuncDef: when useEffectSystem: documentRaises(d.cache, n) d.add genJsonItem(d, n, n[namePos], skProc) - of nkFuncDef: - when useEffectSystem: documentRaises(d.cache, n) - d.add genJsonItem(d, n, n[namePos], skFunc) of nkMethodDef: when useEffectSystem: documentRaises(d.cache, n) d.add genJsonItem(d, n, n[namePos], skMethod) diff --git a/nimdoc/testproject/expected/testproject.html b/nimdoc/testproject/expected/testproject.html index a32e1180c..2bf8855c7 100644 --- a/nimdoc/testproject/expected/testproject.html +++ b/nimdoc/testproject/expected/testproject.html @@ -262,6 +262,11 @@ window.addEventListener('DOMContentLoaded', main);
  • z4
  • + +