|
7 | 7 | - `def __call__(self, scope, receive, send)`
|
8 | 8 | - `def authenticate(self, conn)`
|
9 | 9 |
|
| 10 | +- `def user_pwd_auth(lookup, skip, **kwargs)` |
| 11 | +- `def basic_logout(request)` |
10 | 12 | ## fasthtml.cli
|
11 | 13 |
|
12 | 14 | - `@call_parse def railway_link()`
|
|
19 | 21 |
|
20 | 22 | > `ft_html` and `ft_hx` functions to add some conveniences to `ft`, along with a full set of basic HTML components, and functions to work with forms and `FT` conversion
|
21 | 23 |
|
| 24 | +- `@patch def __str__(self)` |
| 25 | +- `@patch def __radd__(self, b)` |
| 26 | +- `@patch def __add__(self, b)` |
| 27 | +- `def attrmap_x(o)` |
| 28 | +- `def ft_html(tag, *c, **kwargs)` |
| 29 | +- `@use_kwargs(hx_attrs + evt_attrs, keep=True) def ft_hx(tag, *c, **kwargs)` |
22 | 30 | - `def File(fname)`
|
23 | 31 | Use the unescaped text in file `fname` directly
|
24 | 32 |
|
|
34 | 42 | - `def find_inputs(e, tags, **kw)`
|
35 | 43 | Recursively find all elements in `e` with `tags` and attrs matching `kw`
|
36 | 44 |
|
| 45 | +- `def __getattr__(tag)` |
37 | 46 | - `def html2ft(html, attr1st)`
|
38 | 47 | Convert HTML to an `ft` expression
|
39 | 48 |
|
|
80 | 89 | - `def EventStream(s)`
|
81 | 90 | Create a text/event-stream response from `s`
|
82 | 91 |
|
| 92 | +- `def signal_shutdown()` |
| 93 | +- `def uri(_arg, **kwargs)` |
| 94 | +- `def decode_uri(s)` |
| 95 | +- `@patch def to_string(self, value)` |
| 96 | +- `@patch def url_path_for(self, name, **path_params)` |
83 | 97 | - `def flat_tuple(o)`
|
84 | 98 | Flatten lists
|
85 | 99 |
|
|
89 | 103 | - `def respond(req, heads, bdy)`
|
90 | 104 | Default FT response creation function
|
91 | 105 |
|
| 106 | +- `def is_full_page(req, resp)` |
92 | 107 | - `class Redirect`
|
93 | 108 | Use HTMX or Starlette RedirectResponse as required to redirect to `loc`
|
94 | 109 |
|
95 | 110 | - `def __init__(self, loc)`
|
96 | 111 | - `def __response__(self, req)`
|
97 | 112 |
|
| 113 | +- `def get_key(key, fname)` |
98 | 114 | - `def qp(p, **kw)`
|
99 | 115 | Add parameters kw to path p
|
100 | 116 |
|
|
103 | 119 |
|
104 | 120 | - `class FastHTML`
|
105 | 121 | - `def __init__(self, debug, routes, middleware, title, exception_handlers, on_startup, on_shutdown, lifespan, hdrs, ftrs, exts, before, after, surreal, htmx, default_hdrs, sess_cls, secret_key, session_cookie, max_age, sess_path, same_site, sess_https_only, sess_domain, key_fname, body_wrap, htmlkw, nb_hdrs, canonical, **bodykw)`
|
106 |
| - - `def add_route(self, route)` |
107 | 122 |
|
| 123 | +- `@patch def add_route(self, route)` |
108 | 124 | - `@patch def ws(self, path, conn, disconn, name, middleware)`
|
109 | 125 | Add a websocket route at `path`
|
110 | 126 |
|
|
114 | 130 | - `@patch def route(self, path, methods, name, include_in_schema, body_wrap)`
|
115 | 131 | Add a route at `path`
|
116 | 132 |
|
| 133 | +- `@patch def set_lifespan(self, value)` |
117 | 134 | - `def serve(appname, app, host, port, reload, reload_includes, reload_excludes)`
|
118 | 135 | Run the app in an async server, with live reload set as the default.
|
119 | 136 |
|
|
146 | 163 | - `def cookie(key, value, max_age, expires, path, domain, secure, httponly, samesite)`
|
147 | 164 | Create a 'set-cookie' `HttpHeader`
|
148 | 165 |
|
| 166 | +- `def reg_re_param(m, s)` |
149 | 167 | - `@patch def static_route_exts(self, prefix, static_path, exts)`
|
150 | 168 | Add a static route at URL path `prefix` with files from `static_path` and `exts` defined by `reg_re_param()`
|
151 | 169 |
|
|
161 | 179 | - `def __init__(self, content, status_code, headers, cls, media_type, background)`
|
162 | 180 | - `def __response__(self, req)`
|
163 | 181 |
|
| 182 | +- `def unqid(seeded)` |
| 183 | +- `@patch def setup_ws(app, f)` |
| 184 | +- `@patch def devtools_json(self, path, uuid)` |
164 | 185 | ## fasthtml.fastapp
|
165 | 186 |
|
166 | 187 | > The `fast_app` convenience wrapper
|
|
181 | 202 | - `def MarkdownJS(sel)`
|
182 | 203 | Implements browser-based markdown rendering.
|
183 | 204 |
|
| 205 | +- `def KatexMarkdownJS(sel, inline_delim, display_delim, math_envs)` |
184 | 206 | - `def HighlightJS(sel, langs, light, dark)`
|
185 | 207 | Implements browser-based syntax highlighting. Usage example [here](/tutorials/quickstart_for_web_devs.html#code-highlighting).
|
186 | 208 |
|
| 209 | +- `def SortableJS(sel, ghost_class)` |
187 | 210 | - `def MermaidJS(sel, theme)`
|
188 | 211 | Implements browser-based Mermaid diagram rendering.
|
189 | 212 |
|
|
203 | 226 | - `def wait_port_free(port, host, max_wait)`
|
204 | 227 | Wait for `port` to be free on `host`
|
205 | 228 |
|
| 229 | +- `def render_ft()` |
| 230 | +- `def htmx_config_port(port)` |
206 | 231 | - `class JupyUvi`
|
207 | 232 | Start and stop a Jupyter compatible uvicorn server with ASGI `app` on `port` with `log_level`
|
208 | 233 |
|
|
218 | 243 | - `def start(self)`
|
219 | 244 | - `def stop(self)`
|
220 | 245 |
|
221 |
| -- `def HTMX(path, app, host, port, height, link, iframe)` |
| 246 | +- `def HTMX(path, host, app, port, height, link, iframe)` |
222 | 247 | An iframe which displays the HTMX application in a notebook.
|
223 | 248 |
|
| 249 | +- `def ws_client(app, nm, host, port, ws_connect, frame, link, **kwargs)` |
224 | 250 | ## fasthtml.live_reload
|
225 | 251 |
|
| 252 | +- `def LiveReloadJs(reload_attempts, reload_interval, **kwargs)` |
| 253 | +- `def live_reload_ws(websocket)` |
226 | 254 | - `class FastHTMLWithLiveReload`
|
227 | 255 | `FastHTMLWithLiveReload` enables live reloading.
|
228 | 256 | This means that any code changes saved on the server will automatically
|
|
299 | 327 | - `@patch def retr_id(self, code, redirect_uri)`
|
300 | 328 | Call `retr_info` and then return id/subscriber value
|
301 | 329 |
|
| 330 | +- `def url_match(url, patterns)` |
302 | 331 | - `class OAuth`
|
303 | 332 | - `def __init__(self, app, cli, skip, redir_path, error_path, logout_path, login_path, https, http_patterns)`
|
304 | 333 | - `def redir_login(self, session)`
|
|
324 | 353 |
|
325 | 354 | > Basic components for generating Pico CSS tags
|
326 | 355 |
|
| 356 | +- `def set_pico_cls()` |
327 | 357 | - `@delegates(ft_hx, keep=True) def Card(*c, **kwargs)`
|
328 | 358 | A PicoCSS Card, implemented as an Article with optional Header and Footer
|
329 | 359 |
|
|
342 | 372 | - `@delegates(ft_hx, keep=True) def Container(*args, **kwargs)`
|
343 | 373 | A PicoCSS Container, implemented as a Main with class 'container'
|
344 | 374 |
|
| 375 | +- `def PicoBusy()` |
345 | 376 | ## fasthtml.stripe_otp
|
346 | 377 |
|
347 | 378 | - `def create_price(app_nm, amt, currency)`
|
|
350 | 381 | - `def archive_price(app_nm)`
|
351 | 382 | Archive a price - useful for cleanup if testing.
|
352 | 383 |
|
| 384 | +- `def before(sess)` |
| 385 | +- `@rt('/') def home(sess)` |
| 386 | +- `@rt('/create-checkout-session', methods=['POST']) def create_checkout_session(sess)` |
353 | 387 | - `class Payment`
|
354 | 388 |
|
| 389 | +- `@rt('/webhook') def post(req)` |
| 390 | +- `@rt('/success') def success(sess, checkout_sid)` |
| 391 | +- `@rt('/cancel') def cancel()` |
| 392 | +- `@rt('/refund', methods=['POST']) def refund(sess, checkout_sid)` |
| 393 | +- `@rt('/account') def account_management(sess)` |
355 | 394 | ## fasthtml.svg
|
356 | 395 |
|
357 | 396 | > Simple SVG FT elements
|
|
424 | 463 | - `def SvgInb(*args, **kwargs)`
|
425 | 464 | Wraps an SVG shape as required for an HTMX inband swap
|
426 | 465 |
|
| 466 | +## fasthtml.toaster |
| 467 | + |
| 468 | +- `def Toast(message, typ, dismiss, duration)` |
| 469 | +- `def add_toast(sess, message, typ, dismiss)` |
| 470 | +- `def render_toasts(sess)` |
| 471 | +- `def toast_after(resp, req, sess)` |
| 472 | +- `def setup_toasts(app, duration)` |
427 | 473 | ## fasthtml.xtend
|
428 | 474 |
|
429 | 475 | > Simple extensions to standard HTML components, such as adding sensible defaults
|
|
488 | 534 | - `def run_js(js, id, **kw)`
|
489 | 535 | Run `js` script, auto-generating `id` based on name of caller if needed, and js-escaping any `kw` params
|
490 | 536 |
|
| 537 | +- `def HtmxOn(eventname, code)` |
491 | 538 | - `def jsd(org, repo, root, path, prov, typ, ver, esm, **kwargs)`
|
492 | 539 | jsdelivr `Script` or CSS `Link` tag, or URL
|
493 | 540 |
|
|
508 | 555 | - `def Favicon(light_icon, dark_icon)`
|
509 | 556 | Light and dark favicon headers
|
510 | 557 |
|
| 558 | +- `def clear(id)` |
| 559 | +- `def with_sid(app, dest, path)` |
0 commit comments