Search code examples
bitbucketpython-sphinx

How to publish sphinx-generated documentation on bitbucket wiki automatically?


I have a python package with sphinx-generated documentation (using the automodules feature) and it can be made into a set of static html pages sitting in a _build directory in the git repository of the project. I would like to view this documentation in pretty and private way on bitbucket. It seems the wiki which is a git repo itself might be usable for that.

Is there an easy step of sequences that can make/convert my html documentation into markup and push it to the bitbucket wiki repository?


Solution

  • Unfortunately this is not really possible...

    You can push your _build dir to the wiki repo and create links in the wiki (Home.rst) to your html files like so:

    `Sphinx docs <_build/html/index.html>`_
    

    And it will display them but inclusion of _static css/js files won't work, so your docs will look ugly :(

    You could also publish your docs as a website on BitBucket but there's no privacy, your docs will be public even if your repo is private, so this is not very useful, then you can just go with read the docs...

    Read the docs actually supports privacy so you could add your docs in a private mode and add a Webhook in BitBucket. This unfortunately only works with public repos so not a great solution either...

    P.S. There's a reusable app that allows you to privately serve your sphinx docs from django (protected): django-docs ;) And you can build those from your bitbucket *.rst files...