[Checkins] SVN: grok/trunk/doc/ More sample-izing of the tutorial.

Martijn Faassen faassen at infrae.com
Fri Mar 16 17:17:45 EDT 2007


Log message for revision 73252:
  More sample-izing of the tutorial.
  

Changed:
  A   grok/trunk/doc/groktut/generating_html_from_python/
  U   grok/trunk/doc/groktut/generating_html_from_python/src/sample/app.py
  U   grok/trunk/doc/groktut/generating_html_from_python/src/sample/app_templates/index.pt
  U   grok/trunk/doc/tutorial.txt

-=-
Copied: grok/trunk/doc/groktut/generating_html_from_python (from rev 73246, grok/trunk/doc/groktut/publishing_a_simple_web_page)

Modified: grok/trunk/doc/groktut/generating_html_from_python/src/sample/app.py
===================================================================
--- grok/trunk/doc/groktut/publishing_a_simple_web_page/src/sample/app.py	2007-03-16 20:51:35 UTC (rev 73246)
+++ grok/trunk/doc/groktut/generating_html_from_python/src/sample/app.py	2007-03-16 21:17:44 UTC (rev 73252)
@@ -4,4 +4,6 @@
     pass
 
 class Index(grok.View):
-    pass
+    def some_html(self):
+        return "<b>ME GROK BOLD</b>"
+

Modified: grok/trunk/doc/groktut/generating_html_from_python/src/sample/app_templates/index.pt
===================================================================
--- grok/trunk/doc/groktut/publishing_a_simple_web_page/src/sample/app_templates/index.pt	2007-03-16 20:51:35 UTC (rev 73246)
+++ grok/trunk/doc/groktut/generating_html_from_python/src/sample/app_templates/index.pt	2007-03-16 21:17:44 UTC (rev 73252)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Hello world!</p>
+<p tal:content="structure python:view.some_html()"></p>
 </body>
 </html>
\ No newline at end of file

Modified: grok/trunk/doc/tutorial.txt
===================================================================
--- grok/trunk/doc/tutorial.txt	2007-03-16 21:17:20 UTC (rev 73251)
+++ grok/trunk/doc/tutorial.txt	2007-03-16 21:17:44 UTC (rev 73252)
@@ -529,25 +529,16 @@
 and `&lt;`. With the ``structure`` directive, you can tell TAL
 explicitly to not escape HTML this way, so it is passed literally into
 the template. Let's see how this is done. Change ``app.pt`` to read like
-this::
+this:
 
-  import grok
+.. include:: groktut/generating_html_from_python/src/sample/app.py
+  :literal:
 
-  class Sample(grok.Application, grok.Container):
-      pass
+and then change ``index.pt`` to read like the following:
 
-  class Index(grok.View):
-      def some_html(self):
-          return "<b>ME GROK BOLD</b>"
+.. include:: groktut/generating_html_from_python/src/sample/app_templates/index.pt
+  :literal:
 
-and then change ``index.pt`` to read like the following::
-
-  <html>
-  <body>
-  <p tal:content="structure python:view.some_html()"></p>
-  </body>
-  </html>
-
 Let's take another look at our web page:
 
   http://localhost:8080/test



More information about the Checkins mailing list