diff --git a/IATI-Schemas b/IATI-Schemas index 5ccb534f..85f2dca5 160000 --- a/IATI-Schemas +++ b/IATI-Schemas @@ -1 +1 @@ -Subproject commit 5ccb534f109676bbb96201931233cdc99c7362b3 +Subproject commit 85f2dca51a5d1e701bd96f976f3bd24c77139689 diff --git a/gen.py b/gen.py index d93daecc..ef2d3b5b 100644 --- a/gen.py +++ b/gen.py @@ -189,14 +189,14 @@ def output_docs(self, element_name, path, element=None): children = self.element_loop(element, path) for child_name, child_element in children: self.output_docs(child_name, path+element.attrib['name']+'/', child_element) - + with open('docs/'+rst_filename, 'w') as fp: t = self.jinja_env.get_template(self.lang+'/schema_element.rst') fp.write(t.render( element_name=element_name, element_name_underline='='*len(element_name), element=element, - path='/'.join(path.split('/')[1:]), + path='/'.join(path.split('/')[1:]), # Strip e.g. activity-standard/ from the path github_urls=github_urls, schema_documentation=textwrap.dedent(element.find(".//xsd:documentation", namespaces=namespaces).text), extended_types=element.xpath('xsd:complexType/xsd:simpleContent/xsd:extension/@base', namespaces=namespaces), @@ -251,7 +251,7 @@ def output_schema_table(self, element_name, path, element=None, output=False, fi fp.write(t.render( rows=rows, title=title, - root_path=path, + root_path='/'.join(path.split('/')[1:]), # Strip e.g. activity-standard/ from the path match_codelist=match_codelist, description=self.tree.xpath('xsd:annotation/xsd:documentation[@xml:lang="en"]', namespaces=namespaces)[0].text ).encode('utf8'))