GithubHelp home page GithubHelp logo

mouchar / kajiki Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jackrosenthal/kajiki

0.0 1.0 0.0 613 KB

Python XML-based template engine with Genshi-like syntax and Jinja-style blocks

License: Other

Python 95.80% HTML 3.18% C# 0.06% Smalltalk 0.27% Genshi 0.38% Myghty 0.31%

kajiki's Introduction

Kajiki provides fast well-formed XML templates

Because Kajiki's input is XML, it can ensure that your HTML/XML output is well-formed. The Genshi-like syntax, based on XML attributes or tags, is simply beautiful and easily understood (or ignored) by web designers. But instead of the slow performance of Genshi, Kajiki compiles templates to Python code that renders with blazing-fast speed, so Kajiki can compete with the speed of Jinja, Mako, Chameleon and others. Also, one of Genshi's misfeatures -- py:match -- is replaced with blocks which work like Jinja's blocks.

By combining the best ideas out there -- XML input, Genshi's syntax and features, Jinja's template inheritance and final compilation to Python --, Kajiki is ready to become the most widely used templating engine for web development in Python. And more features are coming soon; stay tuned!

Example

>>> import kajiki
>>> Template = kajiki.XMLTemplate('''<html>
...     <head><title>$title</title></head>
...     <body>
...         <h1>$title</h1>
...         <ul>
...             <li py:for="x in range(repetitions)">$title</li>
...         </ul>
...     </body>
... </html>''')
>>> print(Template(dict(title='Kajiki is teh awesome!', repetitions=3)).render())
<html>
    <head><title>Kajiki is teh awesome!</title></head>
    <body>
        <h1>Kajiki is teh awesome!</h1>
        <ul>
            <li>Kajiki is teh awesome!</li><li>Kajiki is teh awesome!</li><li>Kajiki is teh awesome!</li>
        </ul>
    </body>
</html>

Links

Documentation

Kajiki is licensed under an MIT-style license.

The git repository and issue tracker are at GitHub. Previously the project used SourceForge for the hg repository, issue tracker and forums.

We use Travis for continuous integration.

kajiki's People

Contributors

alfredodeza avatar amol- avatar drocco007 avatar fahhem avatar moreati avatar nandoflorestan avatar ollyc avatar pedersen avatar ralphbean avatar rick446 avatar scmmmh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.