Add language attribute to code samples

Create the literal_block nodes with a 'language' attribute to add syntax
highlighting in the generated documentation.

This change is not visible in the HTML output, but is used when the
generated XML is imported in the openstack-manuals hot-reference book
(WIP).

The 'hot' language is not currently supported in sphinx or in the
manuals, but it doesn't hurt to have it and it could be implemented
later.

Change-Id: Ie5d4ab31665da812ccd7ec1232d3858786170477
Implements: blueprint heat-templates
Closes-Bug: #1360559
This commit is contained in:
Gauvain Pocentek 2014-08-03 16:49:10 +02:00
parent 3640b673cb
commit 28231c1b18
1 changed files with 3 additions and 3 deletions

View File

@ -123,7 +123,7 @@ resources:
properties:
%s''' % (self.resource_type, '\n '.join(props))
block = nodes.literal_block('', template)
block = nodes.literal_block('', template, language="hot")
section.append(block)
def contribute_yaml_syntax(self, parent):
@ -145,7 +145,7 @@ Resources:
Properties:
%s''' % (self.resource_type, '\n '.join(props))
block = nodes.literal_block('', template)
block = nodes.literal_block('', template, language='yaml')
section.append(block)
def contribute_json_syntax(self, parent):
@ -170,7 +170,7 @@ Resources:
}
}
}''' % (self.resource_type, ',\n '.join(props))
block = nodes.literal_block('', template)
block = nodes.literal_block('', template, language="json")
section.append(block)
@staticmethod