Parse RST in plug-in class docs

In order to make the generated documentation for resource plug-ins more
readable, parse the class comments as RST and append to the section.

Change-Id: Icb37344c64c21bcac536e8f2916b102eb9754851
This commit is contained in:
Randall Burt 2014-07-10 17:54:52 -05:00
parent 1a2747c5e3
commit 6367aab293
1 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@
import itertools
from docutils import core
from docutils import nodes
import pydoc
from sphinx.util.compat import Directive
@ -66,8 +67,9 @@ class ResourcePages(Directive):
cls_doc = pydoc.getdoc(resource_class)
if cls_doc:
para = nodes.paragraph('', cls_doc)
section.append(para)
# allow for rst in the class comments
cls_nodes = core.publish_doctree(cls_doc).children
section.extend(cls_nodes)
self.contribute_properties(section)
self.contribute_attributes(section)