or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Semantic Markup for plugins
tags:
Documentation
Summary
Community Ansible documentation wants to add semantic markup within the module/plugin DOCUMENTATION strings. This gives all projects that use
ansible-doc --json
output improved flexibility on how to display this information. These projects include Automation Hub,ansible-navigator
, possibly the vscode plugin, and the collection_prep script used by some certified collection owners.Business Justification
By separating what the content is (environment variable, option, value) from how we display it (bold, color, italics) we provide the ability of products such as Automation Hub to visually enhance the display for improved readability of this information.
By formalizing this semantic markup, we also provide the ability to:
Primary goal - To improve the visual aid that helps readers determine what the differences are in such a way that is consumable by other products that display module information (such as Automation Hub).
Solution - Introduce a light level of semantic markup, where the collection creator 'marks' the content for what it is (environment variable, value, option, etc) instead of how it should display (bold, italics, monospace, etc), and that contains more contextual information (which plugin this is an option of, if referring to an option of another plugin/module). This leaves the visual aspect independent and up to the product how to display it. For example - Automation Hub could use bold, italics, or could add colors to the display to enhance the reader's experience.
Markup Specification
The community decided on the following additions:
O(...)
are allowed and provide the ability for CI validation and hotlinks:O(name)
orO(name=value)
for a top-level optionname
of the current plugin/module;O(name.sub)
orO(name.sub=value)
for a suboptionsub
of the top-levle optionname
of the current plugin/module; if you have sub-sub-options, useO(name.sub.subsub)
etc;[]
for options or suboptions, for exampleO(name[])
orO(name.sub[]=value)
orO(name[].sub)
, to indicate that some of the options or suboptions refer to lists. The[]
can also contain other text that's not a]
, for exampleO(name[len(all_names)-1].foo[0])
. This text will be ignored for validation purposes;O(FQCN#type:name)
orO(FQCN#type:name=value)
for a top-level optionname
of the plugin/moduleFQCN
(for example,ansible.builtin.uri
) of plugin typetype
(one ofmodule
,lookup
, …,role
);O(FQCN#type:name.sub.subsub)
orO(FQCN#type:name.sub.subsub=value)
with potential[]
s for a sub-sub-optionsubsub
of a sub-optionsub
of a top-level optionname
of the plugin/moduleFQCN
(for exampleansible.builtin.uri
) of plugin typetype
(one ofmodule
,lookup
, …,role
);[]
for options or suboptions, with the same rules as in 3;ansible-test
'svalidate-modules
sanity check).RV(FQCN#type:name.sub.subsub)
andRV(FQCN#type:name.sub[].subsub=value)
. (For example, for facts returned by another plugin, one can useRV(FQCN#type:ansible_facts.name.sub.subsub)
.)Values in the above forms (the text following
=
inO()
andRV()
, and the whole text inV()
) can use\
to escape)
,\\
to escape\
. This allows to write expressions that contain)
, which is not possible the current markup (C()
,I()
andB()
).Existing markup macros will remain, including:
These added macros may impact other projects, such as Galaxy-ng/Automation Hub, ansible-navigator, possibly the vscode plugin, and the collection_prep script used by some collections to generate local rst docs files.
Extension to "See Also"
The current
seealso:
section in the module/plugin documentation allows to provide references to modules, URLs, and RST references. To reference a plugin, you have to use its RST reference, but that will not work on other platforms (for example Automation Hub/Galaxy). So similarly to addingP(...#...)
, we propose to add a newseealso
type:Simiarly to a
module
entry, the description is optional. For FQCN and plugin type the same values are allowed as forP(FQCN#plugintype)
.Background
This started with a general dissatisfaction on how some of the module options and parameters are displayed on docs.ansible.com (what is bold, what is italics, monospace, etc) and the inherent inflexibility of our current markup options.
The upstream proposal is at https://github.com/ansible-community/community-topics/issues/53
WIP examples:
For more complete details and WIP PRs, see ansible/ansible#75054.