Last thing written... if ever... First thing needed.
I have been messing with formatting my code using numpy doc strings
And! Not only that, your favorite Python Package Manager includes it in their python distribution so Sphinx can use it.
So here is a little 'dirr' function I wrote since dir(object) returns a messy hard to read output in any form.
Here is the documentation for the function.
def dirr(obj, colwise=True, cols=3, sub=None, prn=True):
"""A formatted dir listing of a module or function.
Source : arraytools module in tools.py, dirr def
Return a directory listing of a module's namespace or a part of it if the
`sub` option is specified. If `prn=True`, then it is simply printed. If
False, then the string is returned.
- colwise : `True` or `1`, otherwise, `False` or `0`
- cols : pick a size to suit
- sub : sub='a' all modules beginning with `a`
- prn : `True` for print or `False` to return output as string
See the `inspect` module for possible additions like `isfunction`,
dirr(art, colwise=True, cols=3, sub=None, prn=True) # all columnwise
dirr(art, colwise=True, cols=3, sub='arr', prn=True) # just the `arr`'s
(001) _arr_common arr2xyz arr_json
(002) arr_pnts arr_polygon_fc arr_polyline_fc
(003) array2raster array_fc
(004) array_struct arrays_cols
The key (apparently) is indentation, back-ticks and little tricks.
In Spyder's help documentation, it looks like this. ( More on Spyder as an IDE for your work )
You can produce whole documentation for your modules or even single 'scripts' to accompany your code.
And the function itself makes finding my own documentation easier
Producing links to web links
This may be a bit much, but your documentation can also provide links to http: sites to reference specific web pages from within your documentation. Here is an example. The key is to provide a
- link number ... 
- a name for the link... with trailing __
- and the actual link itself.
|Web links in script documentation|
The **text** provides bold highlighting. The  on line 6, is the first link with line 7 being the link name in back-tics and trailing __. Line 9, with the leading __ is the actual link itself. What is show is a snip of the whole link list shown below.
You might need a simpler documentation example
This consists of `< at the start and >`_. at the end with the link in between. This yields...
Remember, documentation is important. If not for yourself, for someone else.