class RandomWords::LoremMarkdown
def generate
def generate compress_newlines items = { short: 4, medium: 8, long: 10, very_long: 12 }[@options[:length]] if @options[:ul] && @options[:ol] # If both unordered and ordered lists are specified, add them both. inject_block(1, -> { list(items, :ul) }) inject_block(1, -> { list(items, :ol) }) elsif @options[:ul] # If only unordered list is specified, add it. inject_block(2, -> { list(items, :ul) }) elsif @options[:ol] # If only ordered list is specified, add it. inject_block(2, -> { list(items, :ol) }) end # Add definition list if specified. inject_block(1, -> { list(items, :dl) }) if @options[:dl] # Add blockquote if specified. inject_block(1, -> { blockquote(items / 2) }) if @options[:bq] # Add headers if specified. inject_headers if @options[:headers] # Add code block if specified. inject_block(1, -> { code }) if @options[:code] # Add table if specified. inject_block(1, -> { table }) if @options[:table] ensure_block_newlines compress_newlines convert_punctuation end