mirror of
https://github.com/MillironX/nfdocs-parser.git
synced 2024-11-22 08:59:55 +00:00
Promote params_to_table function to NFDocs class
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
This commit is contained in:
parent
d4b3fdc354
commit
c498ec82da
1 changed files with 71 additions and 71 deletions
|
@ -26,7 +26,16 @@ def definition_type(signature):
|
||||||
# Return the results
|
# Return the results
|
||||||
return def_name, def_type
|
return def_name, def_type
|
||||||
|
|
||||||
def params_to_table(type, params):
|
class NFDocs(Directive):
|
||||||
|
# Class default overrides
|
||||||
|
required_arguments = 1
|
||||||
|
|
||||||
|
# Declare the docstring starting characters
|
||||||
|
DOC_STARTER = "/// "
|
||||||
|
|
||||||
|
pe = inflect.engine()
|
||||||
|
|
||||||
|
def params_to_table(self, type, params):
|
||||||
# Create a table
|
# Create a table
|
||||||
params_table = nodes.table()
|
params_table = nodes.table()
|
||||||
if type:
|
if type:
|
||||||
|
@ -60,7 +69,7 @@ def params_to_table(type, params):
|
||||||
|
|
||||||
# Params table
|
# Params table
|
||||||
sub_params_entry = nodes.entry()
|
sub_params_entry = nodes.entry()
|
||||||
sub_params_entry += params_to_table("", param["tuple"])
|
sub_params_entry += self.params_to_table("", param["tuple"])
|
||||||
param_row += sub_params_entry
|
param_row += sub_params_entry
|
||||||
|
|
||||||
# If this is actually a parameter, the new row takes on the form
|
# If this is actually a parameter, the new row takes on the form
|
||||||
|
@ -96,15 +105,6 @@ def params_to_table(type, params):
|
||||||
params_table += params_tgroup
|
params_table += params_tgroup
|
||||||
return params_table
|
return params_table
|
||||||
|
|
||||||
class NFDocs(Directive):
|
|
||||||
# Class default overrides
|
|
||||||
required_arguments = 1
|
|
||||||
|
|
||||||
# Declare the docstring starting characters
|
|
||||||
DOC_STARTER = "/// "
|
|
||||||
|
|
||||||
pe = inflect.engine()
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# Take path as single argument for now
|
# Take path as single argument for now
|
||||||
nextflow_path = self.arguments[0]
|
nextflow_path = self.arguments[0]
|
||||||
|
@ -172,7 +172,7 @@ class NFDocs(Directive):
|
||||||
io_methods = ["input", "output"]
|
io_methods = ["input", "output"]
|
||||||
for met in io_methods:
|
for met in io_methods:
|
||||||
if met in proc_docs.keys():
|
if met in proc_docs.keys():
|
||||||
io_table = params_to_table(met, proc_docs[met])
|
io_table = self.params_to_table(met, proc_docs[met])
|
||||||
proc_section += io_table
|
proc_section += io_table
|
||||||
self.state_machine.document.note_implicit_target(proc_section)
|
self.state_machine.document.note_implicit_target(proc_section)
|
||||||
block_section += proc_section
|
block_section += proc_section
|
||||||
|
|
Loading…
Reference in a new issue