On 7 Jan, 10:23, Georg Brandl <ge...@python.org> wrote: > > > which works fine. But how can I extract the docstrings from my utility > > scripts? > > You can't do that with autodoc if they are not importable.
If you organize your utility scripts like this you will at least be able to get the docstring for the module (file), and data defined: """ Docstring for the script. """ #: Some data that you want autodoc to catch SOME_SETTING = 1 if __name__ == '__main__': # Your code goes here... # but autodoc won't see it, since __name__ != '__main__' when the python file is imported. /Jakob Malm > > Georg > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.16 (GNU/Linux) > > iEYEARECAAYFAk0m26IACgkQN9GcIYhpnLBztACfVAbOJ9XAc8K4QTTOae/TospT > h74AnArp1MH6ZSGMLDuX7TnkIoxI92OC > =cFGr > -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.