Hi, I see that double-hash comments are interpreted as documentation -- the equivalent of Python docstrings.
I would like my code to extract these documentation comments and use them for introspection documentation.
The tutorial mentions that "documentation comments are tokens ... they belong to the syntax tree", and when I use dumpTree to print the AST, I can in fact see my nnkCommentStmt node in there.
However, I can't work out how to extract the comment text in my code. I can't access any internal structure in the nnkCommentStmt node, and I can't find any functions (outside the Nim compiler code) that handle nnkCommentStmt nodes.
Is it possible for non-compiler (non-docgen) code to extract the text of double-hash documentation comments?
Thanks.
@dom96: OK, thanks, done.
I've also been working on another approach, which I'll post about shortly.