From f1b695baf9d3ccf2bf9e4b1b3a82cad48470d8ce Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Mon, 10 Jan 2022 16:15:51 -0600 Subject: [PATCH] Remove function params_to_list from NFDocs class Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com> --- nfdocs-parser.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/nfdocs-parser.py b/nfdocs-parser.py index e424c0d..a482aec 100755 --- a/nfdocs-parser.py +++ b/nfdocs-parser.py @@ -25,6 +25,25 @@ def definition_type(signature): # Return the results return def_name, def_type +def params_to_list(params): + if "tuple" in params.keys(): + tuple_item = nodes.list_item() + if "name" in params.keys(): + tuple_item += nodes.paragraph(text=params["name"]) + tuple_item += nodes.paragraph(text="Tuple:") + tuple_list = nodes.bullet_list() + for io in params["tuple"]: + tuple_list += params_to_list(io) + tuple_item += tuple_list + return tuple_item + else: + io_item = nodes.list_item() + if "name" in params.keys(): + io_item += nodes.paragraph(text=params["name"]) + io_item += nodes.paragraph(text=f"Type: {params['type']}") + io_item += nodes.paragraph(text=params["description"]) + return io_item + class NFDocs(Directive): # Class default overrides required_arguments = 1 @@ -32,25 +51,6 @@ class NFDocs(Directive): # Declare the docstring starting characters DOC_STARTER = "/// " - def params_to_list(self, params): - if "tuple" in params.keys(): - tuple_item = nodes.list_item() - if "name" in params.keys(): - tuple_item += nodes.paragraph(text=params["name"]) - tuple_item += nodes.paragraph(text="Tuple:") - tuple_list = nodes.bullet_list() - for io in params["tuple"]: - tuple_list += self.params_to_list(io) - tuple_item += tuple_list - return tuple_item - else: - io_item = nodes.list_item() - if "name" in params.keys(): - io_item += nodes.paragraph(text=params["name"]) - io_item += nodes.paragraph(text=f"Type: {params['type']}") - io_item += nodes.paragraph(text=params["description"]) - return io_item - def run(self): # Take path as single argument for now nextflow_path = self.arguments[0] @@ -121,7 +121,7 @@ class NFDocs(Directive): io_section += nodes.title(text=met) io_list = nodes.bullet_list() for io in proc_docs[met]: - io_list += self.params_to_list(io) + io_list += params_to_list(io) io_section += io_list proc_section += io_section self.state_machine.document.note_implicit_target(io_section)