Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
mosquito committed Sep 17, 2023
1 parent 1748058 commit 10f2c7f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,50 @@ writes something like this:
</html>
```

# Features

* Any custom tags is supported:
```python
from tagz import html
assert str(html.my_custom_tag("hello")) == "<my-custom-tag>hello</my-custom-tag>"
```
* Pretty printing html
```python
from tagz import html

print(
html.div(
"Hello", html.strong("world"),
).to_string(pretty=True)
)
#<div>
# Hello
# <strong>
# world
# </strong>
#</div>
```
* `Style` helper object:
```python
from tagz import Style
assert str(Style(color="#ffffff")) == "color: #ffffff;"
```
* `StyleSheet` helper object
```python
from tagz import Style, StyleSheet

# body {padding:"0";margin:"0"}
# a, div {transition:"opacity 600ms ease-in"}
print(
str(
StyleSheet({
"body": Style(padding="0", margin="0"),
("div", "a"): Style(transition="opacity 600ms ease-in"),
})
)
)
```

# More examples

## Building page from parts
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tagz"
version = "0.2.3"
version = "0.2.4"
description = "tagz is a html tags builder"
authors = ["Dmitry Orlov <me@mosquito.su>"]
license = "MIT"
Expand Down

0 comments on commit 10f2c7f

Please sign in to comment.