readthedocs.io support

rtd uses 'readthedocs' and 'readthedocssinglehtmllocalmedia' as
builder names. os-api-ref expected 'html' as builder name to
handle the css files correctly.
This change adds the support for the rtd builders.

Change-Id: I21a5144ada79c8c95846ce961169e2505db27a56
Signed-off-by: Gergely Csatari <gergely.csatari@nokia.com>
This commit is contained in:
Gergely Csatari 2018-12-07 14:19:57 +01:00
parent 4fdeb69a5b
commit d636dddb47
1 changed files with 5 additions and 7 deletions

View File

@ -637,7 +637,8 @@ def copy_assets(app, exception):
'glyphicons-halflings-regular.ttf',
'glyphicons-halflings-regular.woff'
)
if app.builder.name != 'html' or exception:
builders = ('html', 'readthedocs', 'readthedocssinglehtmllocalmedia')
if app.builder.name not in builders or exception:
return
LOG.info('Copying assets: %s', ', '.join(assets))
LOG.info('Copying fonts: %s', ', '.join(fonts))
@ -665,12 +666,9 @@ def setup(app):
# TODO(sdague): if someone wants to support latex/pdf, or man page
# generation using these stanzas, here is where you'd need to
# specify content specific renderers.
app.add_node(rest_method,
html=(rest_method_html, None))
app.add_node(rest_expand_all,
html=(rest_expand_all_html, None))
app.add_node(http_code,
html=(http_code_html, None))
app.add_node(rest_method, html=(rest_method_html, None))
app.add_node(rest_expand_all, html=(rest_expand_all_html, None))
app.add_node(http_code, html=(http_code_html, None))
# This specifies all our directives that we're adding
app.add_directive('rest_parameters', RestParametersDirective)