typesrenderer

Imports

renderer, ast, types

Consts

defaultParamSeparator = ","
Source Edit

Procs

proc renderPlainSymbolName(n: PNode): string {...}{.raises: [], tags: [].}

Returns the first non '*' nkIdent node from the tree.

Use this on documentation name nodes to extract the raw symbol name, without decorations, parameters, or anything. That can be used as the base for the HTML hyperlinks.

Source Edit
proc renderParamTypes(n: PNode; sep = defaultParamSeparator): string {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}

Returns the types contained in n joined by sep.

This proc expects to be passed as n the parameters of any callable. The string output is meant for the HTML renderer. If there are no parameters, the empty string is returned. The parameters will be joined by sep but other characters may appear too, like [] or |.

Source Edit

© 2006–2021 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/compiler/typesrenderer.html