Correctly handle subtitles
Correctly handle subtitles

It's possible, though uncommon, for Sphinx extensions to use the
'subtitle' node from docutils [1]. One such example is the OpenStack
community's 'sphinx-feature-classification' extension [2]. Attempting to
render such documentation results in a large stacktrace like so:

  AttributeError: 'docutils.nodes.subtitle' object has no attribute 'elements'

This element will never have an 'elements' attribute, which is a purely
rst2pdf construct. The solution is to instead build this manually by
concatenating the name of the parent element - typically 'section' -
with '-subtitle'. One can choose to style this if they wish, though
Sphinx stylesheets tend not to.

[1] http://code.nabla.net/doc/docutils/api/docutils/nodes/docutils.nodes.subtitle.html
[2] https://git.io/Jf7Xt

Signed-off-by: Stephen Finucane <06fa905d7f2aaced6dc72e9511c71a2a51e8aead@that.guru>

rst2pdf/rst2pdf,rst2pdf/rst2pdf