1818from antsibull_core .utils .io import write_file
1919from jinja2 import Template
2020
21+ from ..docs_parsing import AnsibleCollectionMetadata
2122from ..env_variables import EnvironmentVariableInfo
2223from ..jinja2 .environment import doc_environment
2324from ..utils .collection_name_transformer import CollectionNameTransformer
@@ -55,6 +56,8 @@ async def write_callback_type_index(callback_type: str,
5556
5657async def write_plugin_type_index (plugin_type : str ,
5758 per_collection_plugins : Mapping [str , Mapping [str , str ]],
59+ # pylint:disable-next=unused-argument
60+ collection_metadata : Mapping [str , AnsibleCollectionMetadata ],
5861 template : Template ,
5962 dest_filename : str ,
6063 for_official_docsite : bool = False ) -> None :
@@ -64,6 +67,7 @@ async def write_plugin_type_index(plugin_type: str,
6467 :arg plugin_type: The plugin type to write the index for.
6568 :arg per_collection_plugins: Mapping of collection_name to Mapping of plugin_name to
6669 short_description.
70+ :arg collection_metadata: Dictionary mapping collection names to collection metadata objects.
6771 :arg template: A template to render the plugin index.
6872 :arg dest_filename: The destination filename.
6973 :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,
128132
129133
130134async def output_plugin_indexes (plugin_info : PluginCollectionInfoT ,
135+ collection_metadata : Mapping [str , AnsibleCollectionMetadata ],
131136 dest_dir : str ,
132137 collection_url : CollectionNameTransformer ,
133138 collection_install : CollectionNameTransformer ,
@@ -137,6 +142,7 @@ async def output_plugin_indexes(plugin_info: PluginCollectionInfoT,
137142
138143 :arg plugin_info: Mapping of plugin_type to Mapping of collection_name to Mapping of
139144 plugin_name to short_description.
145+ :arg collection_metadata: Dictionary mapping collection names to collection metadata objects.
140146 :arg dest_dir: The directory to place the documentation in.
141147 :kwarg for_official_docsite: Default False. Set to True to use wording specific for the
142148 official docsite on docs.ansible.com.
@@ -165,8 +171,8 @@ async def output_plugin_indexes(plugin_info: PluginCollectionInfoT,
165171 filename = os .path .join (collection_toplevel , f'index_{ plugin_type } .rst' )
166172 writers .append (await pool .spawn (
167173 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 )))
170176
171177 await asyncio .gather (* writers )
172178
0 commit comments