Import remarkuple module:
from remarkuple import helper as h, table, svg
t = h.div('text ', h.a("link"), h.b(" bold"), h.i(" italic"))
print (t)
t
<div>text <a>link</a><b> bold</b><i> italic</i></div>
csv = """Title,Name,Phone
Mr.,John,07868785831
Miss,Linda,0141-2244-5566
Master,Jack,0142-1212-1234
Mr.,Bush,911-911-911"""
tbl = table()
tbl.addCaption("Contacts")
for idx, row in enumerate(csv.split("\n")):
if idx:
tbl.addBodyRow(h.tr(*[h.td(x) for x in row.split(",")]))
else:
tbl.addHeadRow(h.tr(*[h.th(x) for x in row.split(",")]))
tbl
Title | Name | Phone |
---|---|---|
Mr. | John | 07868785831 |
Miss | Linda | 0141-2244-5566 |
Master | Jack | 0142-1212-1234 |
Mr. | Bush | 911-911-911 |
s = svg().set_axes(False).set_grid(True)
s.set_circle(r=100, fill="green", style="fill-opacity: 50%")
print (s)
h.br
s
<svg height="400" width="400" viewbox="0 0 401 401"><defs><pattern height="12.5" width="12.5" id="gitem4403935944" patternunits="userSpaceOnUse"><path d="M 12.5 0 L 0 0 0 12.5" stroke="gray" stroke-width="0.5" fill="none"/></pattern><pattern height="100.0" width="100.0" id="gid4403935944" patternunits="userSpaceOnUse"><path d="M 100.0 0 L 0 0 0 100.0" stroke="gray" stroke-width="1" fill="none"/><rect width="100.0" height="100.0" fill="url(#gitem4403935944)"/></pattern></defs><rect height="401" width="401" fill="white"/><rect height="401" width="401" fill="url(#gid4403935944)"/><circle cy="200.0" style="fill-opacity: 50%" cx="200.0" r="100" fill="green"/></svg>
print (svg())
<svg height="400" width="400" viewbox="0 0 401 401"/>