Edit: Simplified docutils, sphinx hooks (no need for hook() function)