PHPTAL
dominate
PHPTAL | dominate | |
---|---|---|
1 | 11 | |
175 | 1,648 | |
0.6% | - | |
4.7 | 4.6 | |
about 1 month ago | 26 days ago | |
PHP | Python | |
GNU Lesser General Public License v3.0 only | GNU Lesser General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
PHPTAL
-
Ludic: New framework for Python with seamless Htmx support
I agree and I don't fully understand the why of it.
I remember coding PL/SQL to emmit HTML in Oracle around 1999 or 2000 and using functions to code the various elements.
Thay got old and repetitive very quickly - for instqance, everytime I had to correct a spelling error, I had to recompile the code.
To get around it I used one or two tables to hold html snippets to decouple the business/backend logic from the frontend, and stopped using the PL/SQL functios completely.
My speed of developmet skyrocketed, and separating and abstracting the frontend from the backend made so much sense.
A few years later, I was doing web developemt with Python using the Zope framework (not many people know about it tiday, I think).
It uses a specialised serverside templating language called TAL (Template Attribute Language)[1] that basically builds the front end dynamically, and then you feed it data from the backend.
Very neat and allowed me to build reusable compoments as well as collections of a schema definition (basically a dict), html template(s) and the code to validate that the inpuy matched the schema and could be rendered.
Or something like that its been 2 employers and almost 20 years since i worked with tha :)
I did build a small php extension for Wordpress using a PHP implementation[2] of TAL a few years ago, and TAL still works like a charm :)
My point is that I still believe there is value in keeping python out of the HTMl-templating, and in keeping the front end logic apart from the backend logic.
There is something I am not understanding about the renewal of mixing HTML/GUI template with code, buy I haven't fully found it yet.
[1] https://en.m.wikipedia.org/wiki/Template_Attribute_Language
[2] I believe it was this one https://phptal.org/
dominate
-
Ludic: New framework for Python with seamless Htmx support
It feels weird at the beginning, but after a bit of practice I found it pretty nice to write HTML in Python.
Here is an example of a HTML page layout written with the DOMinate [1] library for example, in a "JSX-like" way:
https://github.com/olivierphi/zakuchess/blob/main/src/apps/w...
It may hurt your eyes at first sight, for sure... But similarly to technologies like Tailwind CSS, it's mostly a matter of getting used to it - and after a while it end ups feeling very natural to use :-)
1: https://github.com/Knio/dominate#readme
-
C++: The Obvious Final Step
Pretty much how https://github.com/Knio/dominate does it, but no context variable binding (otherwise gets messy with lots of nesting)
-
That people produce HTML with string templates is telling us something
You're conflating two things, dynamically creating HTML is great and lets you avoid JS in a lot of cases. It's whether you should treat your HTML document as the tree of nodes that it is in your programming language or treat it like a string.
https://github.com/Knio/dominate is a Python lib that implements this principal.
-
Views / Templates / Custom Widgets ... I just want to display non editable data
Actually excited to giive this HTML field a try - https://github.com/Knio/dominate might come in useful for me to generate the html
-
htmx_gen
How is it different from other existing projects like Dominate?
-
Python and Web Developing
If youโre talking about generating HTML using Python, I highly recommend the library Dominate. Incredibly intuitive and Pythonic way to generate HTML.
- Lona - A web framework for responsive web apps in full python
- Template-less HTML rendering in Python
- What do you guys think of Dominate? Use cases?
-
I made a Python3 framework fro integrating Python with HTML and CSS
Ive mostly used Dominate for my services. https://github.com/Knio/dominate
What are some alternatives?
Twig - Twig, the flexible, fast, and secure template language for PHP
domonic - Create HTML with python 3 using a standard DOM API. Includes a python port of JavaScript for interoperability and tons of other cool features. A fast prototyping library.
Smarty - Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic.
wasmer-python - ๐๐ธ WebAssembly runtime for Python
Latte - โ Latte: the safest & truly intuitive templates for PHP. Engine for those who want the most secure PHP sites.
aiohttp-json-rpc - Implements JSON-RPC 2.0 using aiohttp
Phly Mustache - PHP 5.3 Mustache implementation
ryact - Ryact(Breact but 10x faster): a react-like framework to build super-fast web apps in python.
Mustache - A Mustache implementation in PHP.
tocbot - Build a table of contents from headings in an HTML document.
Foil - PHP template engine for native PHP templates
dashborg-go-sdk - Modern internal tools. Defined, controlled, and deployed directly from backend code. No JavaScript. Secure.