mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
Enable documentation in plugins
Made ansible-doc more plugin agnostic We can have docs in lookup, callback, connectionm strategy, etc Use first docstring and make pepizis happy generalized module_docs to plugin_docs documented cartesian, ssh, default, jsonfile, etc as examples changed lack of docs to warning when listing made smarter about bad docstrings better blacklisting added handling of options/config/envs/etc move blacklist to find_plugins, only need once
This commit is contained in:
parent
d3115ae8f3
commit
7839f70e36
18 changed files with 583 additions and 268 deletions
|
@ -46,7 +46,7 @@ from ansible.parsing.dataloader import DataLoader
|
|||
from ansible.parsing.splitter import parse_kv
|
||||
from ansible.playbook.play import Play
|
||||
from ansible.plugins import module_loader
|
||||
from ansible.utils import module_docs
|
||||
from ansible.utils import plugin_docs
|
||||
from ansible.utils.color import stringc
|
||||
from ansible.vars import VariableManager
|
||||
|
||||
|
@ -356,7 +356,7 @@ class ConsoleCLI(CLI, cmd.Cmd):
|
|||
if module_name in self.modules:
|
||||
in_path = module_loader.find_plugin(module_name)
|
||||
if in_path:
|
||||
oc, a, _, _ = module_docs.get_docstring(in_path)
|
||||
oc, a, _, _ = plugin_docs.get_docstring(in_path)
|
||||
if oc:
|
||||
display.display(oc['short_description'])
|
||||
display.display('Parameters:')
|
||||
|
@ -388,7 +388,7 @@ class ConsoleCLI(CLI, cmd.Cmd):
|
|||
|
||||
def module_args(self, module_name):
|
||||
in_path = module_loader.find_plugin(module_name)
|
||||
oc, a, _, _ = module_docs.get_docstring(in_path)
|
||||
oc, a, _, _ = plugin_docs.get_docstring(in_path)
|
||||
return list(oc['options'].keys())
|
||||
|
||||
def run(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue