From b9464a767ea838cb5a85ccf43b718cd8099bceae Mon Sep 17 00:00:00 2001 From: angrybayblade Date: Sat, 9 Mar 2024 13:52:41 +0530 Subject: [PATCH] chore: substitute script --- README.md | 3 ++- docs/django.md | 12 ++++++------ docs/html.md | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index cc26dbf..e7f3903 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ from ph7.css import CSSObject class flex_center(CSSObject): + """Flex center""" display = "flex" align_items = "center" @@ -69,7 +70,7 @@ Or use python function as JavaScript functions ```python -from ph7.js import console, document, fetch, as_js +from ph7.js import as_js, console, document, fetch async def fetchDog(): diff --git a/docs/django.md b/docs/django.md index 7f534f7..86a104c 100644 --- a/docs/django.md +++ b/docs/django.md @@ -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" @@ -208,7 +207,7 @@ Write your scripts using the [`ph7.js`](/js) APIs. ```python -from ph7.js import console, document, fetch, js_callable, alert +from ph7.js import alert, console, document, fetch, js_callable @js_callable @@ -231,10 +230,11 @@ Use the function in the view ```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__) diff --git a/docs/html.md b/docs/html.md index f1da34e..8032d40 100644 --- a/docs/html.md +++ b/docs/html.md @@ -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 ```