From f39d8f132f5e9c66c7872f62ba615e5ede65e9c7 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 29 Sep 2017 12:14:09 +0200 Subject: [PATCH] Make generated description on the docs more friendly --- docs/generate.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/docs/generate.py b/docs/generate.py index 928eacf1..4feb1518 100755 --- a/docs/generate.py +++ b/docs/generate.py @@ -199,14 +199,27 @@ def generate_index(folder, original_paths): def get_description(arg): """Generates a proper description for the given argument""" desc = [] + otherwise = False if arg.can_be_inferred: - desc.append('If left to None, it will be inferred automatically.') - if arg.is_vector: - desc.append('A list must be supplied for this argument.') - if arg.is_generic: - desc.append('A different Request must be supplied for this argument.') - if arg.is_flag: + desc.append('If left unspecified, it will be inferred automatically.') + otherwise = True + elif arg.is_flag: desc.append('This argument can be omitted.') + otherwise = True + + if arg.is_vector: + if arg.is_generic: + desc.append('A list of other Requests must be supplied.') + else: + desc.append('A list must be supplied.') + elif arg.is_generic: + desc.append('A different Request must be supplied for this argument.') + else: + otherwise = False # Always reset to false if no other text is added + + if otherwise: + desc.insert(1, 'Otherwise,') + desc[-1] = desc[-1][:1].lower() + desc[-1][1:] return ' '.join(desc)