DESCRIPTION.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. =========================
  2. Mako Templates for Python
  3. =========================
  4. Mako is a template library written in Python. It provides a familiar, non-XML
  5. syntax which compiles into Python modules for maximum performance. Mako's
  6. syntax and API borrows from the best ideas of many others, including Django
  7. templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded
  8. Python (i.e. Python Server Page) language, which refines the familiar ideas
  9. of componentized layout and inheritance to produce one of the most
  10. straightforward and flexible models available, while also maintaining close
  11. ties to Python calling and scoping semantics.
  12. Nutshell
  13. ========
  14. ::
  15. <%inherit file="base.html"/>
  16. <%
  17. rows = [[v for v in range(0,10)] for row in range(0,10)]
  18. %>
  19. <table>
  20. % for row in rows:
  21. ${makerow(row)}
  22. % endfor
  23. </table>
  24. <%def name="makerow(row)">
  25. <tr>
  26. % for name in row:
  27. <td>${name}</td>\
  28. % endfor
  29. </tr>
  30. </%def>
  31. Philosophy
  32. ===========
  33. Python is a great scripting language. Don't reinvent the wheel...your templates can handle it !
  34. Documentation
  35. ==============
  36. See documentation for Mako at http://www.makotemplates.org/docs/
  37. License
  38. ========
  39. Mako is licensed under an MIT-style license (see LICENSE).
  40. Other incorporated projects may be licensed under different licenses.
  41. All licenses allow for non-commercial and commercial use.