View Source Bunch.Markdown (Bunch v1.6.1)

A bunch of helpers for generating Markdown text

Summary

Functions

Indents the whole block of text by specified number of hard spaces ( ).

Indents whole block of text by specified number of spaces

Functions

Link to this function

hard_indent(string, level \\ 2)

View Source
@spec hard_indent(String.t(), non_neg_integer()) :: String.t()

Indents the whole block of text by specified number of hard spaces ( ).

Examples

iex>Bunch.Markdown.hard_indent("text")
"  text"

iex>text = """
...>First line
...>Second line
...>Third line
...>"""
iex>Bunch.Markdown.hard_indent(text)
"""
  First line
  Second line
  Third line
"""
iex>Bunch.Markdown.hard_indent(text, 1)
"""
 First line
 Second line
 Third line
"""
Link to this function

indent(string, level \\ 2)

View Source
@spec indent(String.t(), non_neg_integer()) :: String.t()

Indents whole block of text by specified number of spaces

Examples

iex>Bunch.Markdown.indent("text")
"  text"

iex>text = """
...>First line
...>Second line
...>Third line
...>"""
iex>Bunch.Markdown.indent(text)
"""
  First line
  Second line
  Third line
"""
iex>Bunch.Markdown.indent(text, 4)
"""
    First line
    Second line
    Third line
"""