0Pricing
Flask Academy · Lesson

Macros for Repeated Markup

Write template functions to avoid copy-paste.

Repeated Markup Begs for a Function

When the same input field or card markup appears with small tweaks, copying it gets messy. A macro turns that pattern into a reusable function. 🛠️

What a Macro Is

A macro is a template function: you define markup once with parameters, then call it many times with different arguments.

All lessons in this course

  1. Define a Base Template with Blocks
  2. Extend the Base in Child Pages
  3. Include Reusable Partials
  4. Macros for Repeated Markup
← Back to Flask Academy