to_passive_voice / modules /m_htmlrender.py
nanom's picture
Added btn-sm css button style
f8732f2
raw
history blame contribute delete
921 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} btn-sm">
<b>{text}</b><br>
<span class="badge badge-pill badge-light">{category}</span>
</span>
"""
return html if text != "" else ""