'Docxtpl: Add heading level to text

How can I add a heading level to text with docxtpl?

Can I do something like this: ?

rt = RichText()
rt.add('Headername', level=1)



Solution 1:[1]

The simplest way to achieve this is just to adjust the font size of your {{ Headername }} expression in the template document:

screenshot of template

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 p_sutherland