mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Doc fragments to plugins (#50172)
* promote doc_fragments into actual plugins change tests hardcoded path to doc fragments avoid sanity in fragments avoid improper testing of doc_fragments also change runner paths fix botmeta updated comment for fragments updated docs
This commit is contained in:
@@ -352,6 +352,14 @@ LOCALHOST_WARNING:
|
||||
- {key: localhost_warning, section: defaults}
|
||||
type: boolean
|
||||
version_added: "2.6"
|
||||
DOC_FRAGMENT_PLUGIN_PATH:
|
||||
name: documentation fragment plugins path
|
||||
default: ~/.ansible/plugins/doc_fragments:/usr/share/ansible/plugins/doc_fragments
|
||||
description: Colon separated paths in which Ansible will search for Documentation Fragments Plugins.
|
||||
env: [{name: ANSIBLE_DOC_FRAGMENT_PLUGINS}]
|
||||
ini:
|
||||
- {key: doc_fragment_plugins, section: defaults}
|
||||
type: pathspec
|
||||
DEFAULT_ACTION_PLUGIN_PATH:
|
||||
name: Action plugins path
|
||||
default: ~/.ansible/plugins/action:/usr/share/ansible/plugins/action
|
||||
|
||||
@@ -633,12 +633,11 @@ _PLUGIN_FILTERS = _load_plugin_filter()
|
||||
# doc fragments first
|
||||
fragment_loader = PluginLoader(
|
||||
'ModuleDocFragment',
|
||||
'ansible.utils.module_docs_fragments',
|
||||
os.path.join(os.path.dirname(__file__), 'module_docs_fragments'),
|
||||
'',
|
||||
'ansible.plugins.doc_fragments',
|
||||
C.DOC_FRAGMENT_PLUGIN_PATH,
|
||||
'doc_fragments',
|
||||
)
|
||||
|
||||
|
||||
action_loader = PluginLoader(
|
||||
'ActionModule',
|
||||
'ansible.plugins.action',
|
||||
|
||||
@@ -97,7 +97,7 @@ def add_fragments(doc, filename, fragment_loader):
|
||||
|
||||
def get_docstring(filename, fragment_loader, verbose=False, ignore_errors=False):
|
||||
"""
|
||||
DOCUMENTATION can be extended using documentation fragments loaded by the PluginLoader from the module_docs_fragments directory.
|
||||
DOCUMENTATION can be extended using documentation fragments loaded by the PluginLoader from the doc_fragments plugins.
|
||||
"""
|
||||
|
||||
data = read_docstring(filename, verbose=verbose, ignore_errors=ignore_errors)
|
||||
|
||||
Reference in New Issue
Block a user