thomasht86 commited on
Commit
8a02447
1 Parent(s): df7913a
Files changed (1) hide show
  1. app.py +3 -21
app.py CHANGED
@@ -1,26 +1,8 @@
1
  from fasthtml.common import *
2
 
3
- # Add the HighlightJS built-in header
4
- hdrs = (HighlightJS(langs=['python', 'javascript', 'html', 'css']),)
5
-
6
- app, rt = fast_app(hdrs=hdrs)
7
-
8
- code_example = """
9
- import datetime
10
- import time
11
-
12
- for i in range(10):
13
- print(f"{datetime.datetime.now()}")
14
- time.sleep(1)
15
- """
16
 
17
  @rt('/')
18
- def get(req):
19
- return Titled("Markdown rendering example",
20
- Div(
21
- # The code example needs to be surrounded by
22
- # Pre & Code elements
23
- Pre(Code(code_example))
24
- ))
25
 
26
- serve(host="0.0.0.0",port=7860)
 
1
  from fasthtml.common import *
2
 
3
+ app,rt = fast_app()
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  @rt('/')
6
+ def get(): return Div(P('Hello World!'), hx_get="/change")
 
 
 
 
 
 
7
 
8
+ serve(port=7860)