def page_layout(content_list_fn) -> la.Page: return la.Page( la.Section(la.Row(*[la.Column(x) for x in content_list_fn])), title="jazz" )
def test_layout_call_list(page_layout, content_list_fn): a = la.Page(content_list_fn, title="jazz") assert a == page_layout
_irises_path = str(Path("tests/resources/irises.jpg").absolute()) with Path(_irises_path).open("rb") as f: _irises_binary = BytesIO(f.read()) # Add new content classes here content_list = [ (co.Markdown("this _is_ some **markdown**")), (co.Image(_irises_path)), ] # Add new layout classes here layout_list = [ (la.Page(*content_list)), (la.Section(*content_list)), (la.Row(*content_list)), (la.Column(*content_list)), ] # Add new adaptor types here adaptor_list = [ ("this is markdown", co.Markdown), (_irises_path, co.Image), ] if _EXTRAS: import bokeh.layouts as bkl # type: ignore import bokeh.plotting as bkp # type: ignore import matplotlib.pyplot as plt # type: ignore
for j, b in enumerate(layout_list_fn): if i == j: assert a == b else: assert a != b layout_add_list = [ (la.Column(), "miles davis", la.Column(co.Markdown("miles davis"))), ( la.Row(), co.Markdown("ornette coleman"), la.Row(la.Column(co.Markdown("ornette coleman"))), ), ( la.Page("charles mingus"), la.Section("thelonious monk"), la.Page(["charles mingus", "thelonious monk"]), ), ( la.Section(title="jazz"), la.Row(la.Column("john coltrane"), la.Column("wayne shorter")), la.Section(la.Row(la.Column("john coltrane"), la.Column("wayne shorter")), title="jazz"), ), ( la.Column("eric dolphy"), la.Column("grant green"), la.Row(la.Column("eric dolphy"), la.Column("grant green")), ),