|
5 | 5 | # %% auto 0 |
6 | 6 | __all__ = ['sid_scr', 'A', 'AX', 'Form', 'Hidden', 'CheckboxX', 'Script', 'Style', 'double_braces', 'undouble_braces', |
7 | 7 | 'loose_format', 'ScriptX', 'replace_css_vars', 'StyleX', 'Nbsp', 'Surreal', 'On', 'Prev', 'Now', 'AnyNow', |
8 | | - 'run_js', 'HtmxOn', 'jsd', 'Titled', 'Socials', 'YouTubeEmbed', 'Favicon', 'clear', 'with_sid'] |
| 8 | + 'run_js', 'HtmxOn', 'jsd', 'Fragment', 'Titled', 'Socials', 'YouTubeEmbed', 'Favicon', 'clear', 'with_sid'] |
9 | 9 |
|
10 | 10 | # %% ../nbs/api/02_xtend.ipynb |
11 | 11 | from dataclasses import dataclass, asdict |
@@ -178,6 +178,11 @@ def jsd(org, repo, root, path, prov='gh', typ='script', ver=None, esm=False, **k |
178 | 178 | if esm: s += '/+esm' |
179 | 179 | return Script(src=s, **kwargs) if typ=='script' else Link(rel='stylesheet', href=s, **kwargs) if typ=='css' else s |
180 | 180 |
|
| 181 | +# %% ../nbs/api/02_xtend.ipynb |
| 182 | +class Fragment(FT): |
| 183 | + "An empty tag, used as a container" |
| 184 | + def __init__(self, *c): super().__init__('', c, {}, void_=True) |
| 185 | + |
181 | 186 | # %% ../nbs/api/02_xtend.ipynb |
182 | 187 | @delegates(ft_hx, keep=True) |
183 | 188 | def Titled(title:str="FastHTML app", *args, cls="container", **kwargs)->FT: |
|
0 commit comments