I have a working directory containing my project and it is in a version control system. I'd like to create a doc directory inside my project that contains only restructured text files for sphinx.

That is, I don't want sphinx to build html files inside my project, but put them outside so they don't get put into version control.

up vote 5 down vote accepted

So if you question is 'How can I build documentation outside of the source tree', the documentation helps:

sphinx-build -b html sourcedir builddir

Just point builddir to a location outside of your source tree.

Or, depending on your version control system, add the directory you generate your documentation to an 'ignore file' (e.g. .gitignore, .hgignore, ...)

  • I was trying it with sphinx-quickstart--the doc does help, thanks for pointing me to the right place. – Tim May 17 '13 at 20:46
  • For me, this approach still looks for index.rst in the source code folder... I've tried to specify master_doc option in my custom config.py but it does not work. – newlog Feb 19 '15 at 12:17

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.