mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-07 13:41:24 +00:00
utils/doc: include plugin aliases in the docs
If a plugin defines aliases, include the aliases and the parameter values they correspond to inside the docs.
This commit is contained in:
parent
063212c2a9
commit
2a2eafa282
@ -294,6 +294,15 @@ def get_params_rst(parameters):
|
|||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
|
def get_aliases_rst(aliases):
|
||||||
|
text = ''
|
||||||
|
for alias in aliases:
|
||||||
|
param_str = ', '.join(['{}={}'.format(n, format_literal(v))
|
||||||
|
for n, v in alias.params.iteritems()])
|
||||||
|
text += '{}\n{}\n'.format(alias.name, indent(param_str))
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
def underline(text, symbol='='):
|
def underline(text, symbol='='):
|
||||||
return '{}\n{}\n\n'.format(text, symbol * len(text))
|
return '{}\n{}\n\n'.format(text, symbol * len(text))
|
||||||
|
|
||||||
@ -312,7 +321,13 @@ def get_rst_from_plugin(plugin):
|
|||||||
else:
|
else:
|
||||||
desc = ''
|
desc = ''
|
||||||
text += desc + '\n\n'
|
text += desc + '\n\n'
|
||||||
|
|
||||||
|
aliases_rst = get_aliases_rst(plugin.aliases)
|
||||||
|
if aliases_rst:
|
||||||
|
text += underline('aliases', '~') + aliases_rst
|
||||||
|
|
||||||
params_rst = get_params_rst(plugin.parameters)
|
params_rst = get_params_rst(plugin.parameters)
|
||||||
if params_rst:
|
if params_rst:
|
||||||
text += underline('parameters', '~') + params_rst
|
text += underline('parameters', '~') + params_rst
|
||||||
|
|
||||||
return text + '\n'
|
return text + '\n'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user