How to reuse code blocks easily with Jinja2 macros!
HTML-код
- Опубликовано: 22 окт 2020
- Jinja2 macros are amazing tools that help us extract from and decompose templates so that we can reuse code blocks in any other template!
If you want to learn more about Flask, check out our Flask Tutorial for Beginners playlist: • Flask Tutorial for Beg...
And if you want to deep dive into web development with Python, our Complete Python Web course is linked below 👇
-- Links --
🐍 Our Complete Python Web Course: www.udemy.com/course/the-comp...
✅ Subscribe to the channel: ruclips.net/user/tecladocode?s...
✅ Our Discord server: / discord
✅ Twitter: / tecladocode
✅ Instagram: / tecladocode Наука
Very good. Straight to the point
Thank you very much!
This is how I like it! Mostly I hate youtube videos about coding because there is so much "boilerplate content" around it. This is pretty much straight to the point. Good one! Maybe you could add small things around the subject at hand. For example, can you add type annotations to macros and stuff. I am completely new to the subject, so maybe this point wont make any sense. But you get the point^^
Thank you very much! Glad you liked the video. Regarding type definitions, I don't think you can do it with Jinja. You wouldn't get good editor support anyway.
Something I have done is add a comment at the top of particularly complex macros or includes documenting the arguments it should receive and what they are for.
Very nicely explained Jinja Macros in short time, I was able to understand and implement it. Thanks
This is a really nice & crisp explanation.
Great material. Thank you for sharing it.
Super bro, very simplified, I'm subscribed
This is great. And makes me think somebody must create a framework using this core concept.
Beautiful, just beautiful
I did not know macros thanks
Wow!! Do you have any other videos on jinja syntax, keywords?
Thanks for the video! This data in routes is static. What if we've got data in models that we want to show in a more dynamic way?
Hi, do you have any plan on creating a short series on python modules like “python docx” and “docxtpl”? Would be really helpful. Thanks!
thanks so much!
Hey! Just wanted to ask when the Flask Web Development Course will be updated on Udemy, since the course still has Legacy content and the course introduction says that the update would be done in November'20.
awesome. Thank u so much :)
Thanks Ranga! You're welcome!
Ooooh, slick. What if in a scenario where you use the same macro to create multiple tables, you want to pass another class name via the macro function so you can uniquely identify the table? Is that possible?
Cool!
This is so cool.
So, macros help in the reusability of HTML elements, right?
Now do it for a hand of 13 cards in the form {(html code, eg,) ❤(rank, eg) A} where each of the four suits has different css formatting (mainly color).