Jump to content

CheetahTemplate: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
Phd ru (talk | contribs)
Released Cheetah 3.4.0.
 
(43 intermediate revisions by 26 users not shown)
Line 1: Line 1:
{{Short description|Template engine software}}
'''Cheetah''' (or '''CheetahTemplate''') is a [[template engine (web)| template engine]] that uses the [[Python (programming language)|Python programming language]]. It can be used standalone or combined with other tools and frameworks. It is often used for [[server-side scripting]] and [[dynamic web content]] by generating [[HTML]], but can also be used to generate [[source code]]. Cheetah is [[open-source software]] licensed under the [[MIT License]].
{{refimprove|date=May 2017}}
{{ Infobox Software
| name = CheetahTemplate
| logo =
| screenshot =
| caption =
| collapsible =
| author = Tavis Rudd
| developer = Oleg Broytman
| released = {{Start date and age|2001|06}}<ref name=Cheetah095>{{cite web | last=Rudd | first=Tavis | title=0.9.5 | url=https://sourceforge.net/p/cheetahtemplate/mailman/message/4670286/ | publisher=CheetahTemplate | date=June 10, 2001}}</ref>
| latest release version = 3.4.0
| latest release date = {{Start date and age|2024|12|02}}
| latest preview version = 3.4.1a0
| latest preview date = {{Start date and age|2024|12|02}}
| operating system = [[Cross-platform]]
| size =
| programming language = [[Python (programming language)|Python]]
| genre = [[Template processor]]
| license = [[MIT License]]
| website = {{url|https://cheetahtemplate.org/}}
}}
'''Cheetah''' (or '''CheetahTemplate''') is a [[template processor|template engine]] that uses the [[Python (programming language)|Python programming language]]. It can be used standalone or combined with other tools and frameworks. It is often used for [[server-side scripting]] and [[dynamic web content]] by generating [[HTML]], but can also be used to [[Automatic programming|generate source code]]. Cheetah is [[Free software|free]] [[open-source software]] licensed under the [[MIT License]].


[[Templating engine]]s encourage clean separation of content, graphic design, and program code. This leads to more modular, flexible, and reusable site architectures, shorter development time, and code that is easier to understand and maintain.
Templating engines encourage clean separation of content, graphic design, and program code. This leads to more modular, flexible, and reusable site architectures, shorter development time, and code that is easier to understand and maintain. Cheetah compiles templates into optimized, yet readable, Python code. It gives template authors full access to any Python data, and functionality, while providing a way for administrators to selectively restrict access to Python when needed.


Cheetah is included in the [[FreeBSD Ports|FreeBSD Ports collection]] and several [[Linux]] distributions: [[Gentoo Linux|Gentoo]], [[Fedora (operating system)|Fedora]], [[Debian]], and [[Ubuntu Linux|Ubuntu]] among others.
Cheetah compiles templates into optimized, yet readable, Python code. It gives template authors full access to any Python data and functionality, while providing a way for administrators to selectively restrict access to Python when needed.


== Example of Cheetah code ==
Cheetah is included in [[FreeBSD]] and several [[Linux]] distributions: [[Gentoo Linux|Gentoo]], [[Fedora (operating system)|Fedora]], [[Debian]], and [[Ubuntu Linux|Ubuntu]] among others.
<syntaxhighlight lang="html+cheetah">
#from Cheetah.Template import Template
#extends Template


#set $people = [{'name' : 'Tom', 'mood' : 'Happy'}, {'name' : 'Dick',
== External links ==
'mood' : 'Sad'}, {'name' : 'Harry', 'mood' : 'Hairy'}]
* [http://www.cheetahtemplate.org/ Cheetah official website]
* [http://www-128.ibm.com/developerworks/opensource/library/os-pythcheetah IBM developerWorks tutorial]
* [http://www.onlamp.com/pub/a/python/2005/01/13/cheetah.html ONLamp.com tutorial]
* [http://www.devshed.com/c/a/Python/Templating-with-Cheetah Dev Shed tutorial]


<strong>How are you feeling?</strong>
<ul>
#for $person in $people
<li>
$person['name'] is $person['mood']
</li>
#end for
</ul>
</syntaxhighlight>
<ref> [https://cheetahtemplate.org/#cheetah-in-a-nutshell Cheetah in a nutshell]</ref>


==References==
{{web-software-stub}}
{{Reflist}}


== External links ==
[[Category:Python libraries]]
* {{Official|www.cheetahtemplate.org}}
* [http://www.onlamp.com/pub/a/python/2005/01/13/cheetah.html ONLamp.com tutorial] {{Webarchive|url=https://web.archive.org/web/20060616060947/http://www.onlamp.com/pub/a/python/2005/01/13/cheetah.html |date=2006-06-16 }}
* [https://web.archive.org/web/20060613025542/http://www.devshed.com/c/a/Python/Templating-with-Cheetah/ Dev Shed tutorial]

[[Category:Free system software]]
[[Category:Free software programmed in Python]]
[[Category:Python (programming language) software]]
[[Category:Python (programming language) libraries]]
[[Category:Scripting languages]]
[[Category:Scripting languages]]
[[Category:Template engines]]
[[Category:Template engines]]



[[pt:Cheetah]]
{{web-software-stub}}

Latest revision as of 13:25, 2 December 2024

CheetahTemplate
Original author(s)Tavis Rudd
Developer(s)Oleg Broytman
Initial releaseJune 2001; 23 years ago (2001-06)[1]
Stable release
3.4.0 / December 2, 2024; 1 day ago (2024-12-02)
Preview release
3.4.1a0 / December 2, 2024; 1 day ago (2024-12-02)
Written inPython
Operating systemCross-platform
TypeTemplate processor
LicenseMIT License
Websitecheetahtemplate.org

Cheetah (or CheetahTemplate) is a template engine that uses the Python programming language. It can be used standalone or combined with other tools and frameworks. It is often used for server-side scripting and dynamic web content by generating HTML, but can also be used to generate source code. Cheetah is free open-source software licensed under the MIT License.

Templating engines encourage clean separation of content, graphic design, and program code. This leads to more modular, flexible, and reusable site architectures, shorter development time, and code that is easier to understand and maintain. Cheetah compiles templates into optimized, yet readable, Python code. It gives template authors full access to any Python data, and functionality, while providing a way for administrators to selectively restrict access to Python when needed.

Cheetah is included in the FreeBSD Ports collection and several Linux distributions: Gentoo, Fedora, Debian, and Ubuntu among others.

Example of Cheetah code

[edit]
#from Cheetah.Template import Template
#extends Template

#set $people = [{'name' : 'Tom', 'mood' : 'Happy'}, {'name' : 'Dick',
                        'mood' : 'Sad'}, {'name' : 'Harry', 'mood' : 'Hairy'}]

<strong>How are you feeling?</strong>
<ul>
    #for $person in $people
        <li>
            $person['name'] is $person['mood']
        </li>
    #end for
</ul>

[2]

References

[edit]
  1. ^ Rudd, Tavis (June 10, 2001). "0.9.5". CheetahTemplate.
  2. ^ Cheetah in a nutshell
[edit]