mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Remove metadata from docstring parsing as per last week's meeting decision
This commit is contained in:
parent
3ee997b720
commit
996281d748
1 changed files with 13 additions and 1 deletions
|
@ -103,6 +103,17 @@ def get_docstring(filename, verbose=False):
|
||||||
directory.
|
directory.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# FIXME: Should refactor this so that we have a docstring parsing
|
||||||
|
# function and a separate variable parsing function
|
||||||
|
# Can have a function one higher that invokes whichever is needed
|
||||||
|
#
|
||||||
|
# Should look roughly like this:
|
||||||
|
# get_plugin_doc(filename, verbose=False)
|
||||||
|
# documentation = extract_docstring(plugin_ast, identifier, verbose=False)
|
||||||
|
# if not documentation and not (filter or test):
|
||||||
|
# documentation = extract_variables(plugin_ast)
|
||||||
|
# documentation['metadata'] = extract_metadata(plugin_ast)
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'doc': None,
|
'doc': None,
|
||||||
'plainexamples': None,
|
'plainexamples': None,
|
||||||
|
@ -114,7 +125,6 @@ def get_docstring(filename, verbose=False):
|
||||||
'DOCUMENTATION': 'doc',
|
'DOCUMENTATION': 'doc',
|
||||||
'EXAMPLES': 'plainexamples',
|
'EXAMPLES': 'plainexamples',
|
||||||
'RETURN': 'returndocs',
|
'RETURN': 'returndocs',
|
||||||
'ANSIBLE_METADATA': 'metadata'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -155,7 +165,9 @@ def get_docstring(filename, verbose=False):
|
||||||
data[varkey] = child.value.s
|
data[varkey] = child.value.s
|
||||||
display.debug('assigned :%s' % varkey)
|
display.debug('assigned :%s' % varkey)
|
||||||
|
|
||||||
|
# Metadata is per-file rather than per-plugin/function
|
||||||
data['metadata'] = extract_metadata(module_ast=M)[0]
|
data['metadata'] = extract_metadata(module_ast=M)[0]
|
||||||
|
|
||||||
# add fragments to documentation
|
# add fragments to documentation
|
||||||
if data['doc']:
|
if data['doc']:
|
||||||
add_fragments(data['doc'], filename)
|
add_fragments(data['doc'], filename)
|
||||||
|
|
Loading…
Reference in a new issue