0

I have been working on setting up auto documentation for my Python files, which are in a large hierarchy of directory structure. I am able to generate rst and html files for all of them with my scripts and by using autodoc module. I was wondering if it is possible to generate rst and html files in the same directory structure/hierarchy of directories as my Python files.

eg., the relative path of my python file is: python/common/element.py; the rst file generated is: python.common.element.rst; and same for html. I want it to form the same directory structure as for py files, like: sphinx/_build/rst/python/common/element.rst & sphinx/_build/html/python/common/element.html

PS: I am working on ubuntu-14.04 and Sphinx-1.6.3

mzjn
  • 48,958
  • 13
  • 128
  • 248
Akshay Shah
  • 323
  • 2
  • 16

1 Answers1

0

No. Source and build directories must be separate. See the options to sphinx-build.

You could write a script to post-process the output, moving files from the build directory into another.

Steve Piercy
  • 13,693
  • 1
  • 44
  • 57
  • Yes obviously the source and build directories will be different. But my question was to do it inside the build directory itself. Anyways, I will write a script for the same then, to move and arrange files after sphinx-build. – Akshay Shah Sep 15 '17 at 07:06
  • The answer is still no, as each output format has its own subdirectory within the build directory. A post-processing script is your only option. – Steve Piercy Sep 16 '17 at 05:41