Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Used, fixed and extended the module.rst.j2 template #253

Merged
merged 6 commits into from
Nov 22, 2020

Commits on Nov 22, 2020

  1. Added module.rst.j2 template from z/OS MF collection and used it

    Details:
    
    * For consistency with other IBM Z ansible collections, added
      the module.rst.j2 template file from the z/OS MF Ansible collections
      project (https://github.com/IBM/ibm_zos_zosmf), and changed the
      invocation of ansible-doc-extractor to use it.
    
      Note that the file as copied fails on a default value that is
      a list, and the fixes an extensions are in subsequent commits.
    
    Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
    andy-maier authored and sabyadi committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    612493e View commit details
    Browse the repository at this point in the history
  2. Template module.rst.j2: Fixed issue with complex default values of op…

    …tions
    
    Details:
    
    * The module.rst.j2 template attempted to concatenate an option default
      value directly with a string in line 60:
    
      {% set default = ", default: " + spec.default if spec.default else "" %}
    
      If the default value is a list object, the resulting AnsibleSequence
      object cannot be directly concatenated with the literal string.
    
      This change fixes that by adding a 'string' filter to the default.
    
    Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
    andy-maier authored and sabyadi committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    e777976 View commit details
    Browse the repository at this point in the history
  3. Template module.rst.j2: Added support for controlling order of options

    Details:
    
    * So far, the module.rst.j2 template always sorted options by name.
      The default template used by the ansible-doc-extractor maintains
      the source order of options. For projects that want to present
      the options in a certain logical order, it is useful to be able
      to easily switch those behaviors.
    
      This change makes the ordering easily controllable by adding
      a variable 'sorted' to the 'option_generation' macro that
      when true produces order by name, and when false keeps the
      source order.
    
    Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
    andy-maier authored and sabyadi committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    2475dcb View commit details
    Browse the repository at this point in the history
  4. Template module.rst.j2: Made 'returned:' output item optional

    Details:
    
    * So far, the module.rst.j2 template always produced an item
      'returned:' for each option, even when the option does not specify
      a 'returned' property. In that case, there was no value shown.
    
      This change omits the 'returned:' item in the output when an
      option does not specify the 'returned' property.
    
    Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
    andy-maier authored and sabyadi committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    1de0a60 View commit details
    Browse the repository at this point in the history
  5. Updated the docs using the modified module.rst.j2 template

    Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
    andy-maier authored and sabyadi committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    4bb6a29 View commit details
    Browse the repository at this point in the history
  6. Increased min version of Jinja2 to 2.9

    Details:
    
    * The module.rst.j2 template uses the 'tojson' filter added in Jinja2 2.9.
      Increased the minimum version of Jinja2 from 2.8 to 2.9.
    
    Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
    andy-maier authored and sabyadi committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    0c31af7 View commit details
    Browse the repository at this point in the history