PDF documentation build

This change provides the necessary modifications to enable
building of pdf documentation. The resources.py extension
required modification to:
  - prevent attributes from being rendered as stray \items
    outside of a list environment
  - prevent update policies from being rendered as stray
    \items outside of a list environment
  - remove the 'Note:' admonition around the 'Not implemented'
    message when it applies to a sub-property, such as a list.
    The admonition was not rendered as a list item, causing the
    build to fail due to an empty list.

Change-Id: Id4e533430600b5ff03fd63cdc09b9a00741b8e4e
This commit is contained in:
matthew-fuller
2019-09-23 14:09:01 -07:00
parent 73f2cdef7a
commit debff05779
4 changed files with 41 additions and 18 deletions

View File

@@ -271,21 +271,10 @@ htmlhelp_basename = 'Heatdoc'
# -- Options for LaTeX output -------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual])
latex_documents = [
('index', 'Heat.tex', u'Heat Documentation',
('index', 'doc-heat.tex', u'Heat Documentation',
u'Heat Developers', 'manual'),
]
@@ -307,8 +296,16 @@ latex_documents = [
# latex_appendices = []
# If false, no module index is generated.
# latex_domain_indices = True
latex_domain_indices = False
# Disable usage of xindy https://bugzilla.redhat.com/show_bug.cgi?id=1643664
latex_use_xindy = False
latex_elements = {
'makeindex': '',
'printindex': '',
'preamble': r'\setcounter{tocdepth}{3}',
}
# -- Options for manual page output -------------------------------------------

View File

@@ -7,6 +7,14 @@ auto-generated from heat when this documentation is built, so if you are
having issues with an option, please compare your version of heat with the
version of this documentation.
The sample configuration can also be downloaded in `file form <../_static/heat.conf.sample>`_.
.. only:: html
.. literalinclude:: ../_static/heat.conf.sample
The sample configuration can also be downloaded in
`file form <../_static/heat.conf.sample>`_.
.. literalinclude:: ../_static/heat.conf.sample
.. only:: latex
See the online version of this documentation for the full example config
file.

View File

@@ -245,7 +245,10 @@ resources:
if not prop.implemented:
para = nodes.line('', _('Not implemented.'))
note = nodes.note('', para)
definition.append(note)
if sub_prop:
definition.append(para)
else:
definition.append(note)
return
if sub_prop and prop.type not in (properties.Schema.LIST,
@@ -351,11 +354,14 @@ resources:
if not self.attrs_schemata:
return
section = self._section(parent, _('Attributes'), '%s-attrs')
definition_list = nodes.definition_list()
section.append(definition_list)
for prop_key, prop in sorted(self.attrs_schemata.items()):
if prop.support_status.status != support.HIDDEN:
description = prop.description
attr_section = self._prop_section(
section, prop_key, '%s-attr-' + prop_key)
definition_list, prop_key, '%s-attr-' + prop_key)
self._status_str(prop.support_status, attr_section)
@@ -367,9 +373,12 @@ resources:
if not self.update_policy_schemata:
return
section = self._section(parent, _('update_policy'), '%s-updpolicy')
definition_list = nodes.definition_list()
section.append(definition_list)
for _key, _prop in sorted(self.update_policy_schemata.items(),
key=cmp_to_key(self.cmp_prop)):
self.contribute_property(section, _key, _prop)
self.contribute_property(definition_list, _key, _prop)
class IntegrateResourcePages(ResourcePages):

View File

@@ -71,6 +71,15 @@ commands =
rm -rf doc/build
sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
basepython = python3
deps = {[testenv:docs]deps}
whitelist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:api-ref]
basepython = python3
# This environment is called from CI scripts to test and publish