[Checkins] SVN: Sandbox/ulif/megrok.chameleon/ Update docs.
Uli Fouquet
uli at gnufix.de
Sun Feb 22 08:44:13 EST 2009
Log message for revision 97036:
Update docs.
Changed:
U Sandbox/ulif/megrok.chameleon/README.txt
U Sandbox/ulif/megrok.chameleon/setup.py
U Sandbox/ulif/megrok.chameleon/src/megrok/chameleon/README.txt
-=-
Modified: Sandbox/ulif/megrok.chameleon/README.txt
===================================================================
--- Sandbox/ulif/megrok.chameleon/README.txt 2009-02-22 13:27:42 UTC (rev 97035)
+++ Sandbox/ulif/megrok.chameleon/README.txt 2009-02-22 13:44:12 UTC (rev 97036)
@@ -1,24 +1,33 @@
megrok.chameleon
-================
+****************
`megrok.chameleon` makes it possible to use chameleon templates in Grok.
-For more information on Grok and Genshi see:
+Currently support for chameleon genshi templates and chameleon zope
+page templates is provided.
+For more information on Grok and Chameleon templates see:
+
- http://grok.zope.org/
- http://pypi.python.org/pypi/chameleon.zpt
+- http://pypi.python.org/pypi/chameleon.genshi
+.. contents::
+
Requirements
-------------
+============
+.. note:: **This package works only with Python2.5**
+
- Chameleon templates (`chameleon.zpt`) Tested with v 1.0b9.
+- Chameleon genshi templates (`chameleon.genshi`) Tested with v 1.0b3.
- Grok v1.0a1 or later. Tested with 1.0a1.
Installation
-------------
+============
To use Chameleon page templates with Grok all you need is to install
-megrok.chameleon as an egg and include it's zcml. The best place to do
+megrok.chameleon as an egg and include its ZCML. The best place to do
this is to make `megrok.chameleon` a dependency of your application by
adding it to your ``install_requires`` list in ``setup.cfg``. If you
used grokprojet to create your application ``setup.py`` is located in the
@@ -39,7 +48,10 @@
<include package="grok" />
<include package="megrok.chameleon" />
<grok:grok package="." />
-
+
+If you use ``autoInclude`` in your ``configure.zcml``, you should not
+have to do this latter step.
+
Then run ``bin/buildout`` again. You should now see buildout saying
something like::
@@ -51,18 +63,26 @@
Usage
------
+=====
``megrok.chameleon`` supports the Grok standard of placing templates
in a templates directory, for example ``app_templates``, so you can
-use Chameleon page templates by simply placing the Genshi templates in
-the templates directory, just as you would with ZPT templates.
-Although Genshi itself doesn't have a standard for the file extensions
-for Genshi templates, Grok needs to have an association between an
+use Chameleon page templates by simply placing the Chameleon genshi
+templates or Chameleon Zope page templates in the templates directory,
+just as you would with regular ZPT templates. Although chameleon
+templates themselves do not have a standard for the file extensions
+for templates, Grok needs to have an association between an
extension and a type so it knows which type of template each template
-is. `megrok.chameleon` defines the extension .cpt (``Chameleon page
-template``) for Chameleon page templates.
+is. `megrok.chameleon` defines the following extensions:
+* ``.cpt`` (``Chameleon page template``) for Chameleon page templates
+
+* ``.cg`` (``Chameleon genshi template``) for chameleon driven genshi
+ templates
+
+* ``.cgt`` (``Chameleon genshi text template``) for chameleon driven
+ genshi text templates
+
You can also use Chameleon page templates inline. The syntax for this
is::
Modified: Sandbox/ulif/megrok.chameleon/setup.py
===================================================================
--- Sandbox/ulif/megrok.chameleon/setup.py 2009-02-22 13:27:42 UTC (rev 97035)
+++ Sandbox/ulif/megrok.chameleon/setup.py 2009-02-22 13:44:12 UTC (rev 97036)
@@ -1,3 +1,4 @@
+import os
from setuptools import setup, find_packages
version = '0.1dev'
@@ -4,6 +5,9 @@
long_description = (open('README.txt').read() +
'\n\n' +
+ open(os.path.join('src', 'megrok', 'chameleon',
+ 'README.txt')).read() +
+ '\n\n' +
open('CHANGES.txt').read())
setup(name='megrok.chameleon',
Modified: Sandbox/ulif/megrok.chameleon/src/megrok/chameleon/README.txt
===================================================================
--- Sandbox/ulif/megrok.chameleon/src/megrok/chameleon/README.txt 2009-02-22 13:27:42 UTC (rev 97035)
+++ Sandbox/ulif/megrok.chameleon/src/megrok/chameleon/README.txt 2009-02-22 13:44:12 UTC (rev 97036)
@@ -1,5 +1,5 @@
-megrok.chameleon
-****************
+Detailed Description
+********************
Grok-support for using chameleon driven templates.
@@ -31,8 +31,10 @@
Beside this, most rules for regular Zope page templates apply also to
chameleon page templates.
-See the `chameleon.zpt` page for more information.
+See the `chameleon.zpt`_ page for more information.
+.. _chameleon.zpt: http://pypi.python.org/pypi/chameleon.zpt
+
Prerequisites
-------------
@@ -164,6 +166,11 @@
of functionality offered by native genshi parsers. Use `megrok.genshi`
if you want native genshi support.
+See the `chameleon.genshi`_ page for more information.
+
+.. _chameleon.genshi: http://pypi.python.org/pypi/chameleon.genshi
+
+
Prerequisites
-------------
@@ -296,8 +303,8 @@
>>> print open(hunter_cgt, 'rb').read()
ME GROK HUNT ${view.game}!
-Note, that this template has the ``.cgt`` (= **c**ameleon **g**genshi
-**t**ext template) file extension.
+Note, that this template has the ``.cgt`` (= **c**\ ameleon **g**\ enshi
+**t**\ ext template) file extension.
If we render it, all expressions are substituted::
More information about the Checkins
mailing list