Spaces:
Sleeping
Sleeping
File size: 1,220 Bytes
9150552 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
def h1(text):
return f"# {text}\n"
def h2(text):
return f"## {text}\n"
def h3(text):
return f"### {text}\n"
def backtick(text):
return f"`{text}`"
def code(lang, text):
return f"```{lang}\n{text}\n```"
def link(text, url):
return f"[{text}]({url})"
def image(
url,
align=None,
height=None,
size=None,
setAsBackground=False,
):
"""Summary
return markdown image syntax with marp options
Args:
url (str): image url (only online images)
align (str, optional): image alignment (left, right, center)
height (str, optional): image height (ex:"2in")
size (str, optional): cover, contain, auto, fix, x%
setAsBackground (bool, optional): set image as background
Returns:
_type_: _description_
"""
options = ""
if align is not None:
options += f"{align}"
if height is not None:
options += f" {height}"
if size is not None:
options += f" {size}"
if setAsBackground:
options += " bg"
return f"![{options}]({url})"
def quote(text):
return f"> {text}"
def bold(text):
return f"**{text}**"
def italic(text):
return f"*{text}*"
|