Sneact is a python library for building user interfaces
Project description
Sneact
Sneact is a python library for building user interfaces.
That's so draft.
Example 1
Python code
from sneact import Sneact, s, _
from sneact.html import div, p, img
home_page = (+Sneact(scope)
<<div>>_
<<p>> s.title <<-p>>_
<<p>> s.subtitle <<-p>>_
<<div>>_
<<p>> s.text <<-p>>_
<<img(src=s.image)>>_
<<-div>>_
<<-div>>_
)
scope["text"] = "Hello tigers. We love Tigers."
result = home_page.as_html()
Resulting html
<div>
<p>Tiger</p>
<p>About tigers</p>
<div>
<p>Hello tigers. We love Tigers.</p>
<img src="tiger.png">
</div>
</div>
Example 2
Python code
from sneact import Sneact, s, _
from sneact.html import p, h1, header, footer
scope = {}
page = (+Sneact(scope)
<<header>>_
**s.header
<<-header>>_
<<p>> "Lorem you know" <<-p>>_
<<footer>>_
**s.footer
<<-footer>>_
)
scope["header"] = (+Sneact(scope)
<<h1>> "Page" <<-h1>>_
)
scope["footer"] = (+Sneact(scope)
<<p>> "Copyright Kiselev Nikolay 2020" <<-p>>_
)
result = page.as_html()
Resulting html
<header>
<h1>Page</h1>
</header>
<p>Lorem you know</p>
<footer>
<p>Copyright Kiselev Nikolay 2020</p>
</footer>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sneact-0.0.4.tar.gz
(3.4 kB
view hashes)
Built Distribution
sneact-0.0.4-py3-none-any.whl
(4.0 kB
view hashes)