18
18
from antsibull_core .utils .io import write_file
19
19
from jinja2 import Template
20
20
21
+ from ..docs_parsing import AnsibleCollectionMetadata
21
22
from ..env_variables import EnvironmentVariableInfo
22
23
from ..jinja2 .environment import doc_environment
23
24
from ..utils .collection_name_transformer import CollectionNameTransformer
@@ -55,6 +56,8 @@ async def write_callback_type_index(callback_type: str,
55
56
56
57
async def write_plugin_type_index (plugin_type : str ,
57
58
per_collection_plugins : Mapping [str , Mapping [str , str ]],
59
+ # pylint:disable-next=unused-argument
60
+ collection_metadata : Mapping [str , AnsibleCollectionMetadata ],
58
61
template : Template ,
59
62
dest_filename : str ,
60
63
for_official_docsite : bool = False ) -> None :
@@ -64,6 +67,7 @@ async def write_plugin_type_index(plugin_type: str,
64
67
:arg plugin_type: The plugin type to write the index for.
65
68
:arg per_collection_plugins: Mapping of collection_name to Mapping of plugin_name to
66
69
short_description.
70
+ :arg collection_metadata: Dictionary mapping collection names to collection metadata objects.
67
71
:arg template: A template to render the plugin index.
68
72
:arg dest_filename: The destination filename.
69
73
:kwarg for_official_docsite: Default False. Set to True to use wording specific for the
@@ -128,6 +132,7 @@ async def output_callback_indexes(plugin_info: PluginCollectionInfoT,
128
132
129
133
130
134
async def output_plugin_indexes (plugin_info : PluginCollectionInfoT ,
135
+ collection_metadata : Mapping [str , AnsibleCollectionMetadata ],
131
136
dest_dir : str ,
132
137
collection_url : CollectionNameTransformer ,
133
138
collection_install : CollectionNameTransformer ,
@@ -137,6 +142,7 @@ async def output_plugin_indexes(plugin_info: PluginCollectionInfoT,
137
142
138
143
:arg plugin_info: Mapping of plugin_type to Mapping of collection_name to Mapping of
139
144
plugin_name to short_description.
145
+ :arg collection_metadata: Dictionary mapping collection names to collection metadata objects.
140
146
:arg dest_dir: The directory to place the documentation in.
141
147
:kwarg for_official_docsite: Default False. Set to True to use wording specific for the
142
148
official docsite on docs.ansible.com.
@@ -165,8 +171,8 @@ async def output_plugin_indexes(plugin_info: PluginCollectionInfoT,
165
171
filename = os .path .join (collection_toplevel , f'index_{ plugin_type } .rst' )
166
172
writers .append (await pool .spawn (
167
173
write_plugin_type_index (
168
- plugin_type , per_collection_data , plugin_list_tmpl , filename ,
169
- for_official_docsite = for_official_docsite )))
174
+ plugin_type , per_collection_data , collection_metadata , plugin_list_tmpl ,
175
+ filename , for_official_docsite = for_official_docsite )))
170
176
171
177
await asyncio .gather (* writers )
172
178
0 commit comments