provider/ansible/documentation.rb
# Takes in a string (representing a paragraph) and returns a multi-line
# string, where each line is less than max_length characters long and all
# subsequent lines are indented in by spaces characters
#
# Example:
#   - This is a sentence
#     that wraps under
#     the bullet properly
#
#   - |
#     This is a sentence
#     that wraps under
#     the bullet properly
#     because of the :
#     character
Takes in a string (representing a paragraph) and returns a multi-line
string, where each line is less than max_length characters long and all
subsequent lines are indented in by spaces characters

This is a sentence
that wraps under
the bullet properly

|
This is a sentence
that wraps under
the bullet properly
because of the :
character
Takes in a string ( representing a paragraph ) and returns a multi - line string where each line is less than max_length characters long and all subsequent lines are indented in by spaces characters This is a sentence that wraps under the bullet properly | This is a sentence that wraps under the bullet properly because of the : character
def bullet_line(paragraph, spaces, multiline = true, add_period = true)
        indented = wrap_field(paragraph.tr("\n", ' '), spaces + 2)
        indented = indented.split("\n")
        if multiline && UNSAFE_CHARS.any? { |c| paragraph.include?(c) }
          indented = ['- |'] + indented
        else
          indented[0] = indented[0].sub(/^../, '- ')
        end
        if add_period
          indented[-1] += '.' unless indented.last.end_with?('.')
        end
        indented
      end
def bullet_line ( paragraph , spaces , multiline = true , add_period = true ) indented = wrap_field ( paragraph . tr ( "\n" , ' ' ) , spaces + 2 ) indented = indented . split ( "\n" ) if multiline && UNSAFE_CHARS . any? { | c | paragraph . include? ( c ) } indented = [ '- |' ] + indented else indented [ 0 ] = indented [ 0 ] . sub ( / ^.. / , '- ' ) end if add_period indented [ - 1 ] += '.' unless indented . last . end_with? ( '.' ) end indented end
Takes in a string (representing a paragraph) and returns a multi-line
string, where each line is less than max_length characters long and all
subsequent lines are indented in by spaces characters
Takes in a string ( representing a paragraph ) and returns a multi - line string where each line is less than max_length characters long and all subsequent lines are indented in by spaces characters
# + 2 for "- " # Remove arbitrary newlines created by formatting in YAML files
paragraph
<not_specific>
spaces
<not_specific>
multiline
<not_specific>
add_period
<not_specific>