デザイナとデベロッパは同じツールを使いません: デザイナは大抵HTMLエディタ(例えばDreamweaverとかAmaya)を使いますし、デベロッパはテキストエディタ、そしてCherryPyを使うわけです。
<div py-include="header.html">header</div> (CHTL form) or <py-include="header.html"> (CGTL form)
テンプレートファイルはCherryPyプロセッサによってコードに入れられます(Cの「#include」命令にとても良く似ています)。 テンプレートを見つけ出すために、プロセッサは同じディレクトリ内と他のソースファイル(/lib, /src, -I フラグで指定されたディレクトリ)を探します。
ステップバイステップでやっていきましょう。
******************* * File header.html ******************* <html><body> Welcome to the CherryPy py-include demo.<br> You are here: home<br><br> ******************* * File footer.html ******************* <br><br><small>Don't forget to eat cherry pie every day</small> </body></html> ******************* * File page1.html ******************* Header Welcome to page1.<br> Click <a href="page2">here</a> to go to page 2. Footer ******************* * File page2.html ******************* Header Welcome to page2.<br> Click <a href="page1">here</a> to go to page 1 Footer特に変なものはないです。ヘッダ、フッタ、2つのボディを持つだけです。全て静的データです。
CherryClass Root: mask: def page1(self, youAreHereLabel='page1'): <py-include="page1.html"> def page2(self, youAreHereLabel='page2'): <py-include="page2.html">
これでウェブサイトの動くバージョンができたわけです:あとはCherryPyのソースコードをコンパイルし、サーバーを立ち上げてテストするだけです。
This document was generated using the LaTeX2HTML translator Version 2K.1beta (1.48)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -split 3 -link 1 -ascii_mode -local_icons -no_navigation collaborate.tex
The translation was initiated by Debian User on 2003-08-26