Skip to content

Commit

Permalink
Sort variables and outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart Gall committed Dec 10, 2019
1 parent 6e13f13 commit d9da3e5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docgen
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,21 @@ class TFDoc:
text = f'''# {self._outline['title']}\n\n{self._outline['text']}'''

text += '## Argument Reference\n\n'
for (var, attribute) in self._variables.items():
for var in sorted(self._variables.keys()):
attribute = self._variables[var]
default = f'''(optional, default: {attribute['default']})''' if attribute['default'] else '(Required)'
text += f'''- ```{var}``` - {default} [{attribute['type']}] {attribute['description']} {attribute['text']}\n\n'''

for (section, attributes) in self._sections.items():
text += f'''## {section}\n\n{attributes['text']}\n'''
for (section, attribute) in self._sections.items():
text += f'''## {section}\n\n{attribute['text']}\n'''

text += '## Attributes Reference\n\n'
for (var, attributes) in self._outputs.items():
text += f'''- ```{var}``` {attributes['text']}\n'''
for var in sorted(self._outputs.keys()):
attribute=self._outputs[var]
text += f'''- ```{var}``` {attribute['text']}\n'''

for (section, attributes) in self._footers.items():
text += f'''## {section}\n\n{attributes['text']}\n'''
for (section, attribute) in self._footers.items():
text += f'''## {section}\n\n{attribute['text']}\n'''

text += self._unclassified_text

Expand Down

0 comments on commit d9da3e5

Please sign in to comment.