Skip to content

Commit

Permalink
minor changes + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan committed Mar 1, 2024
1 parent 618b0b7 commit f965a6b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
... Docs are coming (2024/03/1) ... ;-)

Meanwhile, you can learn a lot on [htag's demo](https://htag.glitch.me/) ... or better [try/repl your self](https://raw.githack.com/manatlan/htag/main/examples/pyscript_demo.html)
(it's an htag app, running with the runner PyScript, in a simple html page, which provide examples in a html editor) ;-)
(it's an htag app, running with the runner PyScript, in a simple html page, which provide examples in an html editor) ;-)


## Quick start
Expand All @@ -21,7 +21,7 @@ Create a starter app ;-)
```bash
$ pyhon3 -m htag
```
(it will create a "main.py" basic app)
(it will create a "main.py" basic htag app)

Start the app :

Expand Down
4 changes: 4 additions & 0 deletions htag/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class App(Tag.body):
def init(self):
self += "Hello World"
self += Tag.button("Say hi", _onclick=self.sayhi)
def sayhi(self,o):
self+="hi!"
#=================================================================================
from htag.runners import Runner
Expand Down
21 changes: 21 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

# -*- coding: utf-8 -*-
# the simplest htag'app, in the best env to start development (hot reload/refresh)

from htag import Tag

class App(Tag.body):
statics="body {background:#EEE;}"

def init(self):
self += "Hello World"
self += Tag.button("Say hi", _onclick=self.sayhi)

def sayhi(self,o):
self+="hi!"

#=================================================================================
from htag.runners import Runner

if __name__=="__main__":
Runner(App).run()

0 comments on commit f965a6b

Please sign in to comment.