Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.42 KB

README.md

File metadata and controls

47 lines (34 loc) · 1.42 KB

Fuchs Templates

Fuchs Templates is a simple template engine for HTML/XML written in Python.

Fuchs is the successor of TEX (Template Engine X)

Inspiration

Fuchs was clearly influenced by template engines like Handlebars, Jinja and Genshi. And deliberately combines everything to ensure the best comfort with the highest quality.

Functional references

Fuchs takes its cue from PHP, it has a syntax that allows to execute Python code.

<!DOCTYPE html>
<html>
    <?fuchs 
        # valid python code inside here
        abc = "abc"
    ?>
    <p>{{abc}}</p>
</html>
<!DOCTYPE html>
<html>
    <?fuchs 
        # valid python code inside here
        import random
        abc = random.randint(1,10)
    ?>
    <p>{{abc}}</p>
</html>

Why not Jinja?

For my web framework Wire, I really wanted something that came from myself. I mean, it's easy to add any dependency and be satisfied. But, I don't want that.

Note

Since Fuchs works exclusively on the server side, any security measures were removed when evaluating the code. Keywords like quit(), exit() etc. are therefore usable. Please avoid using them.