Added docgen documentation

Improvements over pull request #792.