/houdini_additional_python_docs

:snake: Additional documentation of Houdini Python modules

Primary LanguagePython

Houdini additional Python documentation

Additional documentation of Houdini Python modules

Info

Generated documentation can be found here

If you did some scripting in Houdini, then chances are that you have found toolutils module quite handy. But searching in Houdini online help is not very helpful, you will not find much information about it. Maybe some useful code snippets, but not its documentation.

As it turns out there are some handy modules coming with Houdini, but they can be a bit hidden to many users. So I decided to do a small project and auto-generate documentation from docstrings from those modules. I used Sphinx for this.

Current documentation was generated from Houdini 17.5.226

Update

My initial approach involved using hython as interpreter for sphinx-build and I was deleting modules which would not import.

It is not needed anymore since I found out autodoc_mock_imports option which you can find in conf.py. This means that listed modules will not be documented, but all modules that depend on them will be documented fine (they will be importable by Sphinx). This allowed me to generate documentation for much more modules. It is still not perfect, but if you have any suggestions, then you are most welcome to let me know :).

Guide (linux)

  • Install Sphinx (e.g. using pip)

    $ pip install sphinx
    $ pip install sphinx_rtd_theme
    
  • Clone this repo and enter it

    $ git clone https://github.com/jtomori/houdini_additional_python_docs.git
    $ cd houdini_additional_python_docs
    
  • Copy Python files from Houdini: $HH/python3.7libs

    $ cp -r $HH/python3.7libs .
    

    $HH will be present after sourcing Houdini environment, if you are outside of Houdini environment, then replace $HH with your Houdini installation directory, e.g.:

    $ cp -r /opt/hfsXX.X.XXX/houdini/python3.7libs .
    

    Some of the modules do not need to be documented, so delete them

    $ rm -r python3.7libs/whoosh python3.7libs/hou.py
    

    Those two modules are already documented

  • Generate rst files from modules

    $ sphinx-apidoc -o source "%EDEV_HOUDIR%\\houdini\\python3.7libs"
    
  • Build html documentation

    Sphinx workaround: change python27\Lib\site-packages\sphinx\util\inspect.py:729 => to catch all exceptions and return )
    $ make html
    ( windows)
    $ sphinx-build -b html source html -j auto
    
  • Now you have nice online documentation of Houdini Python modules, you will find it in build/html directory. You can push it to gh-pages branch.