0

I have a package written, call it MAUDIE. Also in the folder containing the MAUDIE modules, I have a docs folder containing the sphinx documentation, and a tutorial folder. In the tutorial folder, I have a file use_Maudie.py, it's a script to run a basic use case at the command line, with a function use_maudie().

I want to include the docustring from use_maudie() in my documentation, and tried the following:

.. currentmodule:: MAUDIE.tutorial.use_Maudie
.. autofunction:: use_maudie

This (probably obviously) didn't work, as there is no module MAUDIE.tutorial. Is there a way to include the formatted version of the use_maudie() Docustring and still leave use_Maudie.py in the tutorial folder?

mzjn
  • 48,958
  • 13
  • 128
  • 248
user2954167
  • 155
  • 1
  • 3
  • 14
  • If the `tutorial` folder is in `sys.path`, then `.. currentmodule:: use_Maudie` followed by `.. autofunction:: use_maudie` should work. – mzjn Jul 29 '21 at 16:41
  • @mzjn, The sys.path directs to the `MAUDIE` folder, which *contains* the tutorial folder. So it's `sys.path.insert(0, os.path.abspath('/Users/me/Desktop/'))`, which is where the `MAUDIE` folder is, and then the path to `tutorial` is /Users/me/Desktop/MAUDIE/tutorial/ – user2954167 Jul 29 '21 at 16:47
  • 2
    As far as I can tell, you need one `sys.path` entry for `/Users/me/Desktop/MAUDIE` and one for `/Users/me/Desktop/MAUDIE/tutorial`. – mzjn Jul 29 '21 at 16:55
  • @mzjn Ah Ha!! Thank you :) – user2954167 Jul 29 '21 at 16:59

0 Answers0