On 03/17/2018 08:18 PM, Manasvi Saxena wrote:
Hello Sir,
On Saturday, March 17, 2018 at 2:23:45 PM UTC+5:30, Curtis Maloney wrote:
On 03/17/2018 07:37 PM, Dmitriy Sintsov wrote:
> Hi!
>
> Template languages are my favorite topic in programming.
Having written a few template engines myself... I guess it's high on my
list too :)
> If you implement html library yourself, it is much better to
define tags
> not as functions but as classes with base Tag class which has
properties
> for tag name, attributes and the nested list of tags. Such way
you will
> re-implement DOM, although it is already available in lxml library.
>
> So maybe it's a better idea to figure out whether lxml can be
used as
> template engine for Django, because it can load source html into
nested
> structures via binary optimized code. It should be cleaner and
faster
> than manual composition of html in Python code.
Now, I like this idea as a line of inquiry.
Despite the Django Template Language being explicitly designed to _not_
use HTML syntax [like so many before it did] so as (a) not create
torturous syntaxs, and (b) not restrict it to just HTML...
I think for the case of knowingly generating HTML, using lxml opens the
door to:
1. ensuring valid markup
2. faster processing [maybe?]
3. minifying on the fly -- readable templates, minimal output.
--
Curtis
I was trying to explain the exact pros you have stated above and those
were the main reason behind how I come up with this idea.
Can you guide me how I should move forward with my idea in order to
increase my chances of getting selected in spite of that fact that it's
rejected by the members of Django core team?
Well, you should probably look at past examples of such things, like TAL
for the server side, and ... just about every JS framework of today
(svelte, Vue, Knockout, etc :)
lxml should make it easy to parse, iterate, walk, mutate the DOM tree...
now you need to determine a syntax.
--
Curtis
--
You received this message because you are subscribed to the Google Groups "Django
developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/b708db98-2fe9-fcdf-cb1b-3978e5ee4eb2%40tinbrain.net.
For more options, visit https://groups.google.com/d/optout.