|
158 | 158 | "outputs": [], |
159 | 159 | "source": [ |
160 | 160 | "#| export\n", |
161 | | - "def render_ft():\n", |
| 161 | + "def render_ft(**kw):\n", |
| 162 | + " \"Call once in a notebook or solveit dialog to auto-render components\"\n", |
162 | 163 | " @patch\n", |
163 | | - " def _repr_markdown_(self:FT): return to_xml(Div(self, Script('if (window.htmx) htmx.process(document.body)')))" |
| 164 | + " def _repr_markdown_(self:FT):\n", |
| 165 | + " scr_proc = Script('if (window.htmx) htmx.process(document.body)')\n", |
| 166 | + " return to_xml(Div(self, scr_proc, **kw))" |
164 | 167 | ] |
165 | 168 | }, |
166 | 169 | { |
|
489 | 492 | "text/html": [ |
490 | 493 | "<meta charset=\"utf-8\">\n", |
491 | 494 | "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\">\n", |
492 | | - "<script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/htmx.js\"></script><script src=\"https://cdn.jsdelivr.net/gh/answerdotai/[email protected]/fasthtml.js\"></script><script src=\"https://cdn.jsdelivr.net/gh/answerdotai/surreal@main/surreal.js\"></script><script src=\"https://cdn.jsdelivr.net/gh/gnat/css-scope-inline@main/script.js\"></script><script id=\"_9KAKqmADTB2z5Tid0GamWQ\">if (window.htmx) htmx.process(document.body)</script>" |
| 495 | + "<script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/htmx.js\"></script><script src=\"https://cdn.jsdelivr.net/gh/answerdotai/[email protected]/fasthtml.js\"></script><script src=\"https://cdn.jsdelivr.net/gh/answerdotai/surreal@main/surreal.js\"></script><script src=\"https://cdn.jsdelivr.net/gh/gnat/css-scope-inline@main/script.js\"></script><script id=\"_AxFC49bqTX_vvHITdKX34w\">if (window.htmx) htmx.process(document.body)</script>" |
493 | 496 | ], |
494 | 497 | "text/plain": [ |
495 | 498 | "<IPython.core.display.HTML object>" |
|
551 | 554 | { |
552 | 555 | "data": { |
553 | 556 | "text/markdown": [ |
554 | | - "<div id=\"_g7uKZu_ARsq-n3THwmSmWw\">\n", |
555 | | - " <div id=\"_0h9Dbvf-R0amBDsWTQQWZg\"></div>\n", |
556 | | - "<script id=\"_EToaMaxrRDa8MVsJAH_28Q\">if (window.htmx) htmx.process(document.body)</script></div>\n" |
| 557 | + "<div id=\"_PxvQ15IuRXm9FIIqzd0s2g\">\n", |
| 558 | + " <div id=\"_BxxYJqh2RdOaxF3FIK0VBA\"></div>\n", |
| 559 | + "<script id=\"_T5tPsHW3S4CHyiz8qnhcTA\">if (window.htmx) htmx.process(document.body)</script></div>\n" |
557 | 560 | ], |
558 | 561 | "text/plain": [ |
559 | | - "div(('',),{'id': '_0h9Dbvf-R0amBDsWTQQWZg'})" |
| 562 | + "div(('',),{'id': '_BxxYJqh2RdOaxF3FIK0VBA'})" |
560 | 563 | ] |
561 | 564 | }, |
562 | 565 | "execution_count": null, |
|
0 commit comments