def list_block(*args): new_value = [_span("code-literal", '[')] for i, c in enumerate(args): append = quote(c) if 'span' not in c else c new_value.append(_span("str", append)) if i < len(args) - 1: new_value.append(_span("kept", ', ')) new_value.append(_span("code-literal", ']')) return format_html(_div('code-block', ''.join(new_value)))
def br_25(): # return format_html(""" # <span class="f-size-10"> # <br><br> # </span> # """) return format_html(_span('f-size-40', '<br><br>'))
def dict_block(*args): new_value = [_span("code-literal", ' {')] for i, c in enumerate(args): # append = _span("str", quote(c)) if isinstance(c, str) else _span("int", c) append = quote(c) if 'span' not in c else c append = _span("str", append) new_value.append(append) if i < len(args) - 1: append = _span("kept", ', ') if i % 2 != 0 else _span("code-literal", ': ') new_value.append(append) new_value.append(_span("code-literal", '}')) return mark_safe(_div('code-block', ''.join(new_value)))
def span(value, *args, **kwargs): """""" value = _join(value, args) if 'cls' in kwargs: id = kwargs['id'] if 'id' in kwargs else None value = _span(kwargs['cls'], value, id) else: value = _span_onlyid(value, kwargs['id']) return format_html(value)
def cl(value): return format_html(_span("code-literal", value))
def k(value): return format_html(_span("kept", value))
def it(value): return format_html(_span("italic", value))
def cb(value, tabs): return format_html(_span("code-break", value + ' ' * tabs))
def n(value): return format_html(_span("int", value))
def string(value): return mark_safe(_span("str", value))
def op7_mleft95(value, id=None): return format_html(_span(f"op-07 m-left-95", value, id))
def op7_mleft136(value, id=None): return format_html(_span("op-07 m-left-136", value, id))
def dark_grey(value): return format_html(_span("dark grey", value))
def m(value): return format_html(_span("magic", value))
def turq(value): return format_html(_span("turquoise", value))
def self(value): return format_html(_span("self", value))
def dl_turq(value): return format_html(_span("download-link turquoise", value))
def sup(value): return format_html(_span("super", value))
def ind(value): return format_html(_span("indented", value))
def span(value, cls): return format_html(_span(cls, value))
def ind_half(value): return format_html(_span("indented-half", value))
def mono_bg_it(value): return format_html(_span("monospace-bg italic", value))
def white(value): return format_html(_span("white", value))
def doc_bold(value): return format_html(_span("doc bold", value))
def br_15(): return format_html(_span('f-size-10', '<br><br>'))