The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

SYNOPSIS

   yaml2adoc [-o output] [file ...]

DESCRIPTION

This script does something very similar to https://github.com/debops/yaml2rst, which is a helper tool to aid in documenting Ansible roles used by https://debops.org. All yaml2rst basically does is take a YAML file, collect the comment lines (starting with #), and output those as text (well, reStructuredText). The remaining, source lines are converted to literal blocks.

This module does the same, but it outputs AsciiDoc rather than reStructuredText for folks like me who would rather document their roles using the latter.

You can simply call yaml2adoc with an input file path as a parameter; without this, YAML input is read from the standard input. Normally, output is written to the standard output, but you may use the -o option to specify an output file.

OPTIONS

-o output

Write output to output instead of stdout.

RETURN VALUE

This script returns 0 on success or a value greater than 0 on failure.

EXAMPLES

Generate documentation for main.yaml:

    yaml2adoc -o defaults.adoc defaults.yaml

CAVEATS

This module is as bare-bones as it gets. YAML is not actually parsed, simply the leading comment markers are checked.

The implementation is also most likely suboptimal; your contributions are welcome :-)