mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Improve Markdown (and other) module doc output
- The html_ify filter now escapes HTML found in module documentation. THIS COULD AFFECT MORE THAN JUST MARKDOWN but I didn't see any modules expecting to use e.g. HTML entities or HTML tags in their documentation. - The markdown_ify filter (used as jpfunc in markdown.j2) escapes at least a few Markdown in-line formatting characters. - Improvements to markdown.j2: - Call jpfunc on the module name heading so that it gets escaped for Markdown (e.g. my_module_name becomes my\_module\_name). - Added paragraph breaks between paragraphs in the description. - Added examples heading, which is consistent with the notes heading below it.
This commit is contained in:
parent
cf2ddb6f80
commit
7681b1ce68
2 changed files with 16 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
## @{ module }@
|
||||
## @{ module | jpfunc }@
|
||||
|
||||
{# ------------------------------------------
|
||||
#
|
||||
|
@ -11,7 +11,8 @@ New in version @{ version_added }@.
|
|||
{% endif %}
|
||||
|
||||
{% for desc in description -%}
|
||||
@{ desc | jpfunc }@
|
||||
@{ desc | jpfunc }@
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% if options -%}
|
||||
|
@ -35,6 +36,10 @@ New in version @{ version_added }@.
|
|||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% if examples or plainexamples %}
|
||||
#### Examples
|
||||
{% endif %}
|
||||
|
||||
{% for example in examples %}
|
||||
{% if example['description'] %}
|
||||
* @{ example['description'] | jpfunc }@
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue