Skip to content

Commit

Permalink
Implement seealso for plugins.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Feb 1, 2022
1 parent d01b5c9 commit 6b9b257
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/antsibull/data/docsite/plugin.rst.j2
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ See Also
{% elif item.module is defined %}
@{ ('M(' + item['module'] + ')') | rst_ify }@
The official documentation on the **@{ item['module'] }@** module.
{% elif item.plugin is defined and item.plugin_type is defined and item.description %}
@{ ('P(' + item['plugin'] + '#' + item['plugin_type'] + ')') | rst_ify }@ @{ item['plugin_type'] }@ plugin
@{ item['description'] | rst_ify }@
{% elif item.plugin is defined and item.plugin_type is defined %}
@{ ('P(' + item['plugin'] + '#' + item['plugin_type'] + ')') | rst_ify }@ @{ item['plugin_type'] }@ plugin
The official documentation on the **@{ item['plugin'] }@** @{ item['plugin_type'] }@ plugin.
{% elif item.name is defined and item.link is defined and item.description %}
`@{ item['name'] }@ <@{ item['link'] }@>`_
@{ item['description'] | rst_ify }@
Expand Down
6 changes: 6 additions & 0 deletions src/antsibull/data/docsite/role.rst.j2
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ See Also
{% elif item.module is defined %}
@{ ('M(' + item['module'] + ')') | rst_ify }@
The official documentation on the **@{ item['module'] }@** module.
{% elif item.plugin is defined and item.plugin_type is defined and item.description %}
@{ ('P(' + item['plugin'] + '#' + item['plugin_type'] + ')') | rst_ify }@ @{ item['plugin_type'] }@ plugin
@{ item['description'] | rst_ify }@
{% elif item.plugin is defined and item.plugin_type is defined %}
@{ ('P(' + item['plugin'] + '#' + item['plugin_type'] + ')') | rst_ify }@ @{ item['plugin_type'] }@ plugin
The official documentation on the **@{ item['plugin'] }@** @{ item['plugin_type'] }@ plugin.
{% elif item.name is defined and item.link is defined and item.description %}
`@{ item['name'] }@ <@{ item['link'] }@>`_
@{ item['description'] | rst_ify }@
Expand Down
11 changes: 10 additions & 1 deletion src/antsibull/schemas/docs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ class SeeAlsoModSchema(BaseModel):
description: str = ""


class SeeAlsoPluginSchema(BaseModel):
plugin: str
plugin_type: str
description: str = ""


class SeeAlsoRefSchema(BaseModel):
description: str
ref: str
Expand Down Expand Up @@ -505,7 +511,10 @@ class DocSchema(BaseModel):
filename: str = ''
notes: t.List[str] = []
requirements: t.List[str] = []
seealso: t.List[t.Union[SeeAlsoModSchema, SeeAlsoRefSchema, SeeAlsoLinkSchema]] = []
seealso: t.List[t.Union[SeeAlsoModSchema,
SeeAlsoPluginSchema,
SeeAlsoRefSchema,
SeeAlsoLinkSchema]] = []
todo: t.List[str] = []
version_added: str = 'historical'
version_added_collection: str = COLLECTION_NAME_F
Expand Down

0 comments on commit 6b9b257

Please sign in to comment.