Debian Codegraph @

docs/index.rst

raw
1 .. Cheetah Template Engine documentation master file, created by
2 sphinx-quickstart on Sun May 31 22:23:43 2009.
3 You can adapt this file completely to your liking, but it should at least
4 contain the root `toctree` directive.
5
6 Cheetah3, the Python-Powered Template Engine
7 ============================================
8
9 Introduction
10 ------------
11 Cheetah3 is a free and `open source
12 <https://github.com/CheetahTemplate3/cheetah3>`_ template engine and
13 code-generation tool written in `Python <http://python.org>`_. Cheetah can be
14 used unto itself, or incorporated with other technologies and stacks regardless
15 of whether they're written in Python or not.
16
17 At its core, Cheetah is a domain-specific language for markup generation and
18 templating which allows for full integration with existing Python code but also
19 offers extensions to traditional Python syntax to allow for easier text-generation.
20
21 It's a fork of the `original <https://github.com/cheetahtemplate/cheetah>`_
22 CheetahTemplate library.
23
24 Talk Cheetah
25 ^^^^^^^^^^^^
26 You can get involved and talk with Cheetah developers on the `Cheetah3 issue
27 tracker <https://github.com/CheetahTemplate3/cheetah3/issues>`_.
28
29 Contents
30 ^^^^^^^^^
31
32 .. toctree::
33 :maxdepth: 2
34
35 authors.rst
36 news.rst
37 developers.rst
38 download.rst
39 users_guide/index.rst
40 documentation.rst
41 roadmap.rst
42 dev_guide/index.rst
43 chep.rst
44
45
46 Cheetah in a nutshell
47 ---------------------
48 Below is a simple example of some Cheetah code, as you can see it's practically
49 Python. You can import, inherit and define methods just like in a regular Python
50 module, since that's what your Cheetah templates are compiled to :) ::
51
52 #from Cheetah.Template import Template
53 #extends Template
54
55 #set $people = [{'name' : 'Tom', 'mood' : 'Happy'}, {'name' : 'Dick',
56 'mood' : 'Sad'}, {'name' : 'Harry', 'mood' : 'Hairy'}]
57
58 <strong>How are you feeling?</strong>
59 <ul>
60 #for $person in $people
61 <li>
62 $person['name'] is $person['mood']
63 </li>
64 #end for
65 </ul>
66
67
68 Why Cheetah?
69 ------------
70
71 * Cheetah is supported by every major Python web framework.
72 * It is fully documented and is supported by an active user community.
73 * It can output/generate any text-based format.
74 * Cheetah compiles templates into optimized, yet readable, Python code.
75 * It blends the power and flexibility of Python with a simple template language that non-programmers can understand.
76 * It gives template authors full access to any Python data structure, module, function, object, or method in their templates. Meanwhile, it provides a way for administrators to selectively restrict access to Python when needed.
77 * Cheetah makes code reuse easy by providing an object-oriented interface to templates that is accessible from Python code or other Cheetah templates. One template can subclass another and selectively reimplement sections of it. Cheetah templates can be subclasses of any Python class and vice-versa.
78 * It provides a simple, yet powerful, caching mechanism that can dramatically improve the performance of a dynamic website.
79 * It encourages clean separation of content, graphic design, and program code. This leads to highly modular, flexible, and reusable site architectures, shorter development time, and HTML and program code that is easier to understand and maintain. It is particularly well suited for team efforts.
80 * Cheetah can be used to generate static html via its command-line tool.
81
82
83 Indices and tables
84 ------------------
85
86 * :ref:`genindex`
87 * :ref:`modindex`
88 * :ref:`search`
89