Skip to content

Commit

Permalink
chore: substitute script
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Mar 9, 2024
1 parent 8177df1 commit b9464a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ from ph7.css import CSSObject


class flex_center(CSSObject):
"""Flex center"""

display = "flex"
align_items = "center"
Expand All @@ -69,7 +70,7 @@ Or use python function as JavaScript functions

<!-- {"type": "js", "file": "examples/js_example.py"} -->
```python
from ph7.js import console, document, fetch, as_js
from ph7.js import as_js, console, document, fetch


async def fetchDog():
Expand Down
12 changes: 6 additions & 6 deletions docs/django.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,9 @@ from ph7.css import CSSObject


class main(CSSObject):

display = "flex"
align_items = "center"
justify_content = "center"
justify_content = "center"

height = "100vh"
width = "100vw"
Expand Down Expand Up @@ -208,7 +207,7 @@ Write your scripts using the [`ph7.js`](/js) APIs.

<!-- {"type": "html", "file": "examples/django_app/javascript/templates/script.py", "input_only": true} -->
```python
from ph7.js import console, document, fetch, js_callable, alert
from ph7.js import alert, console, document, fetch, js_callable


@js_callable
Expand All @@ -231,10 +230,11 @@ Use the function in the view

<!-- {"type": "html", "file": "examples/django_app/javascript/templates/__init__.py", "input_only": true} -->
```python
from ph7.html import body, button, div, head, html, img
from ph7.context import ctx
from javascript.templates.script import fetchDog
from javascript.templates.styles import main, image
from javascript.templates.styles import image, main

from ph7.context import ctx
from ph7.html import body, button, div, head, html, img

ctx.static.view(__name__)

Expand Down
6 changes: 3 additions & 3 deletions docs/html.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ print(f"Third render: {time.perf_counter() - tick}")
```

```stdout
First render: 6.573292917
Second render: 0.5675741249999993
Third render: 0.40496804200000014
First render: 6.121663833
Second render: 0.3590905419999997
Third render: 0.3504045420000006
```
<!-- end -->

Expand Down

0 comments on commit b9464a7

Please sign in to comment.