to_passive_voice / modules /m_htmlrender.py
nanom's picture
Remodularization. Added style.css
e5fc5ba
raw
history blame
914 Bytes
class HtmlRender:
def __init__(
self
) -> None:
pass
def output(
self,
html: str
) -> str:
template = "<center>{}</center>"
return template.format(html)
def error(
self,
html: str
) -> str:
template = """
<center>
<div class="alert alert-warning" role="alert">
<h6><b>{}</b></h6>
</div>
</center>
"""
return template.format(html)
def budget(
self,
text: str,
category: str,
color: str
) -> str:
html = f"""
<span type="button" title="{category}" class="btn btn-{color}">
<b>{text}</b><br>
<span class="badge badge-pill badge-light">{category}</span>
</span>
"""
return html if text != "" else ""