wooey / Wooey

A Django app that creates automatic web UIs for Python scripts.
http://wooey.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.12k stars 182 forks source link

Auto-loading of documentation from script text blocks #56

Open mfitzp opened 9 years ago

mfitzp commented 9 years ago

Add support for importing blocks of text documentation from the header of scripts in Python block text format. This might be something better handled in clinto (?) though it's not directly related to argparsing.

Blocks like those found in this file would be pulled out. We can probably achieve this with some simple regex/file parsing looking for triple-quoted strings """ in the top-level of the script.

mfitzp commented 9 years ago

Looking into this it appears that you can pull out the top-level documentation from a script using import x; x.__doc__ so this is even easier.