Ansible Community
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Help
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# 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: * Create CI tests that validate the information at the point of creation. * Maintain consistency across collections. (Today, one content creator could decide to mark a module option in bold while another content creator can mark it as italics.) This creates inconsistencies in how the information displays across certified collections and products that lowers the presumed 'quality' of the information. * Create more embedded links between information. Today, if a module mentions a particular option, there is no way we can link directly to that option. With semantic markup, we can create those links so that a reader can click and learn what that option means and how to use it. * Show tooltips which provide more information on the option (type, beginning of description, link to full documentation) when the user hovers over a mention of them. **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(key) and O(key=value)** for option names, with or without values * The following forms of `O(...)` are allowed and provide the ability for CI validation and hotlinks: 1. `O(name)` or `O(name=value)` for a top-level option `name` of the current plugin/module; 2. `O(name.sub)` or `O(name.sub=value)` for a suboption `sub` of the top-levle option `name` of the current plugin/module; if you have sub-sub-options, use `O(name.sub.subsub)` etc; 3. The same as 1 or 2, but with `[]` for options or suboptions, for example `O(name[])` or `O(name.sub[]=value)` or `O(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 example `O(name[len(all_names)-1].foo[0])`. This text will be ignored for validation purposes; 4. `O(FQCN#type:name)` or `O(FQCN#type:name=value)` for a top-level option `name` of the plugin/module `FQCN` (for example, `ansible.builtin.uri`) of plugin type `type` (one of `module`, `lookup`, ..., `role`); 5. `O(FQCN#type:name.sub.subsub)` or `O(FQCN#type:name.sub.subsub=value)` with potential `[]`s for a sub-sub-option `subsub` of a sub-option `sub` of a top-level option `name` of the plugin/module `FQCN` (for example `ansible.builtin.uri`) of plugin type `type` (one of `module`, `lookup`, ..., `role`); 6. The same as 4 and 5, but with `[]` for options or suboptions, with the same rules as in 3; 7. The FQCN variants (4 to 6) are needed to reference options in other plugins/modules; to reference options in the current plugin/module, variants 1 to 3 can be used. The FQCN is needed both for creating links, and for validating (`ansible-test`'s `validate-modules` sanity check). * **V(value)** for standalone option values * **E(env_var)** for environment variables * **P(FQCN#plugintype)** for plugin references * **RV(name)** or **RV(name=value)** for return values, with similar allowed forms as used by **O(name)**, i.e. `RV(FQCN#type:name.sub.subsub)` and `RV(FQCN#type:name.sub[].subsub=value)`. (For example, for facts returned by another plugin, one can use `RV(FQCN#type:ansible_facts.name.sub.subsub)`.) Values in the above forms (the text following `=` in `O()` and `RV()`, and the whole text in `V()`) can use `\` to escape `)`, `\\` to escape `\`. This allows to write expressions that contain `)`, which is not possible the current markup (`C()`, `I()` and `B()`). Existing markup macros will remain, including: * **M(FQCN)** for module references * **C(code)** for other monospace text such as linux commands * **B(boldtext)** and **I(italic_text)** for other words or phrases an author wants to emphasize. 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 adding `P(...#...)`, we propose to add a new `seealso` type: ```.yaml seealso: - plugin: (FQCN of plugin) plugin_type: (type of plugin) description: (optional description) ``` Simiarly to a `module` entry, the description is optional. For FQCN and plugin type the same values are allowed as for `P(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: * https://ansible.fontein.de/collections/community/dns/hetzner_dns_record_set_module.html#parameters * https://ansible.fontein.de/collections/community/dns/hetzner_dns_record_sets_module.html#parameters For more complete details and WIP PRs, see [ansible/ansible#75054](https://github.com/ansible/ansible/issues/75054).

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

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.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully