Compare commits
1 commit
master
...
docstring-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebf7b2bb3a |
1 changed files with 3 additions and 2 deletions
|
|
@ -269,12 +269,13 @@ proc getCommentsStr*(gState: State, commentNodes: seq[TSNode]): string =
|
|||
## Generate a comment from a set of comment nodes. Comment is guaranteed
|
||||
## to be able to be rendered using nim doc
|
||||
if commentNodes.len > 0:
|
||||
result = "::"
|
||||
result = "```"
|
||||
for commentNode in commentNodes:
|
||||
result &= "\n " & gState.getNodeVal(commentNode).strip()
|
||||
|
||||
result = result.replace(re" *(//|/\*\*|\*\*/|/\*|\*/|\*)", "")
|
||||
result = result.multiReplace([("\n", "\n "), ("`", "")]).strip()
|
||||
result = result.multiReplace([("\n", "\n ")]).strip()
|
||||
result &= "\n```"
|
||||
|
||||
proc getCommentNodes*(gState: State, node: TSNode, maxSearch=1): seq[TSNode] =
|
||||
## Get a set of comment nodes in order of priority. Will search up to ``maxSearch``
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue