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
@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
"""
@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
"""