comment_parser icon indicating copy to clipboard operation
comment_parser copied to clipboard

Python doc string support? (triple quotes)

Open sebastiansam55 opened this issue 3 years ago • 4 comments

I'm not sure if the triple quotes officially qualify as "comments" but they are often used in the same fashion;

https://github.com/autokey/autokey/blob/develop/lib/autokey/scripting/clipboard_gtk.py

In the files in this repo all of the real documentation takes place within the triple quote python thing not the python comments. It would be nice if there was some way to add the definition of what the script considers to be a "comment"

Thanks!

sebastiansam55 avatar Mar 25 '21 18:03 sebastiansam55

I was also looking to extract these three quote comment blocks but unfortunately the extract_comments only grabs the # comments

smturro2 avatar May 20 '21 16:05 smturro2

did you solve this @smturro2

dt1729 avatar Nov 07 '23 03:11 dt1729

@dt1729 No we ended up coding our own parser.

smturro2 avatar Nov 07 '23 03:11 smturro2

There's actually a docstring-parser available now trying that.

Edit: Some regex and docstring parser does it for me.

dt1729 avatar Nov 07 '23 04:11 dt1729