You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by mx...@apache.org on 2012/05/15 12:59:58 UTC
svn commit: r1338639 - in /tcl/rivet/trunk: ChangeLog
doc/examples-sgml/hello1.rvt doc/examples-sgml/vars.rvt
doc/examples/hello1.rvt doc/examples/vars.rvt doc/rivet.xml
doc/xml/examples.xml doc/xml/request.xml
Author: mxmanghi
Date: Tue May 15 10:59:58 2012
New Revision: 1338639
URL: http://svn.apache.org/viewvc?rev=1338639&view=rev
Log:
* doc/hello1.rvt: add new "Hello World!" example to explain the new shorthand syntax <?= ... ?>
Added:
tcl/rivet/trunk/doc/examples-sgml/hello1.rvt
tcl/rivet/trunk/doc/examples/hello1.rvt
Modified:
tcl/rivet/trunk/ChangeLog
tcl/rivet/trunk/doc/examples-sgml/vars.rvt
tcl/rivet/trunk/doc/examples/vars.rvt
tcl/rivet/trunk/doc/rivet.xml
tcl/rivet/trunk/doc/xml/examples.xml
tcl/rivet/trunk/doc/xml/request.xml
Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1338639&r1=1338638&r2=1338639&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Tue May 15 10:59:58 2012
@@ -1,3 +1,6 @@
+2012-05-15 Massimo Manghi <mx...@apache.org>
+ * doc/hello1.rvt: add new "Hello World!" example to explain the new shorthand syntax <?= ... ?>
+
2012-05-14 Massimo Manghi <mx...@apache.org>
* doc/rivet.xsl,doc/rivet.css,doc/images/[prev.png,next.png,up.png]: new stylesheet and icons for
the page manual
@@ -28,8 +31,8 @@
2012-05-09 Massimo Manghi <mx...@apache.org>
* rivet/rivet-tcl/http_accept.tcl: new command ::rivet::http_accept
* doc/xml/commands.xml: new manual entry for ::rivet::http_accept
- * doc/rivet.xml: Add new file entities.xml describing package 'RivetEntities'
- (only a stub, to be elaborated)
+ * doc/rivet.xml: Add new file entities.xml describing package 'RivetEntities' (only a
+ stub, to be elaborated)
* doc/xml/entities.xml: New manual page for package 'RivetEntities'
2012-05-08 Massimo Manghi <mx...@apache.org>
Added: tcl/rivet/trunk/doc/examples-sgml/hello1.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/examples-sgml/hello1.rvt?rev=1338639&view=auto
==============================================================================
--- tcl/rivet/trunk/doc/examples-sgml/hello1.rvt (added)
+++ tcl/rivet/trunk/doc/examples-sgml/hello1.rvt Tue May 15 10:59:58 2012
@@ -0,0 +1,2 @@
+<?= "Hello World" ?>
+
Modified: tcl/rivet/trunk/doc/examples-sgml/vars.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/examples-sgml/vars.rvt?rev=1338639&r1=1338638&r2=1338639&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/examples-sgml/vars.rvt (original)
+++ tcl/rivet/trunk/doc/examples-sgml/vars.rvt Tue May 15 10:59:58 2012
@@ -38,19 +38,19 @@ if { [llength $errlist] != 0 } {
<tbody>
<tr>
<td><b>Title:</b></td>
- <td><? puts $title ?></td>
+ <td><?= $title ?></td>
</tr>
<tr>
<td><b>Boss:</b></td>
- <td><? puts $boss ?></td>
+ <td><?= $boss ?></td>
</tr>
<tr>
<td><b>Salary:</b></td>
- <td><? puts $salary ?></td>
+ <td><?= $salary ?></td>
</tr>
<tr>
<td><b>Skills:</b></td>
- <td><? puts $skills ?></td>
+ <td><?= $skills ?></td>
</tr>
</tbody>
</table>
Added: tcl/rivet/trunk/doc/examples/hello1.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/examples/hello1.rvt?rev=1338639&view=auto
==============================================================================
--- tcl/rivet/trunk/doc/examples/hello1.rvt (added)
+++ tcl/rivet/trunk/doc/examples/hello1.rvt Tue May 15 10:59:58 2012
@@ -0,0 +1 @@
+<?= "Hello World" ?>
Modified: tcl/rivet/trunk/doc/examples/vars.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/examples/vars.rvt?rev=1338639&r1=1338638&r2=1338639&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/examples/vars.rvt (original)
+++ tcl/rivet/trunk/doc/examples/vars.rvt Tue May 15 10:59:58 2012
@@ -38,19 +38,19 @@ if { [llength $errlist] != 0 } {
<tbody>
<tr>
<td><b>Title:</b></td>
- <td><? puts $title ?></td>
+ <td><?= $title ?></td>
</tr>
<tr>
<td><b>Boss:</b></td>
- <td><? puts $boss ?></td>
+ <td><?= $boss ?></td>
</tr>
<tr>
<td><b>Salary:</b></td>
- <td><? puts $salary ?></td>
+ <td><?= $salary ?></td>
</tr>
<tr>
<td><b>Skills:</b></td>
- <td><? puts $skills ?></td>
+ <td><?= $skills ?></td>
</tr>
</tbody>
</table>
Modified: tcl/rivet/trunk/doc/rivet.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/rivet.xml?rev=1338639&r1=1338638&r2=1338639&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/rivet.xml (original)
+++ tcl/rivet/trunk/doc/rivet.xml Tue May 15 10:59:58 2012
@@ -3,6 +3,7 @@
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/committees/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY hello.rvt SYSTEM "examples-sgml/hello.rvt" >
+ <!ENTITY hello1.rvt SYSTEM "examples-sgml/hello1.rvt" >
<!ENTITY table.rvt SYSTEM "examples-sgml/table.rvt" >
<!ENTITY vars.html SYSTEM "examples-sgml/vars.html" >
<!ENTITY vars.rvt SYSTEM "examples-sgml/vars.rvt" >
Modified: tcl/rivet/trunk/doc/xml/examples.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/xml/examples.xml?rev=1338639&r1=1338638&r2=1338639&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/xml/examples.xml (original)
+++ tcl/rivet/trunk/doc/xml/examples.xml Tue May 15 10:59:58 2012
@@ -1,29 +1,57 @@
<section id="examples">
<title>Examples and Usage</title>
<para>
- Some examples of Rivet usage follow. Some prior Tcl knowledge
- is assumed. If you don't know much Tcl, don't worry, it's easy,
- and there are some good resources available on the web that will
- get you up to speed quickly. Go to the
- <link linkend="websites">web sites</link> section and have a look.
+ Some examples of Rivet usage follow. Some prior Tcl knowledge
+ is assumed. If you don't know much Tcl, don't worry, it's easy,
+ and there are some good resources available on the web that will
+ get you up to speed quickly. Go to the
+ <link linkend="websites">web sites</link> section and have a look.
</para>
<example id="hello world">
- <title>Hello World</title>
- <para>
+ <title>Hello World</title>
+ <para>
As with any tool, it's always nice to see something work, so
let's create a small "Hello World" page.
- </para>
- <para>
+ </para>
+ <para>
Assuming you have Apache configured correctly, create a file
called <filename>hello.rvt</filename> where Apache can find
it, with the following content:
- </para>
- <programlisting>&hello.rvt;</programlisting>
- <para>
+ </para>
+ <programlisting>&hello.rvt;</programlisting>
+ <para>
If you then access it with your browser, you should see a
blank page with the text "Hello World" (without the quotes) on it.
- </para>
+ The command <command>puts</command> is the good old Tcl command for
+ terminal printing, which appends to the argument string the control
+ characters needed to open a newline. When you don't have to run through
+ complex elaboration and the output can be condensated
+ in a single string (just like in the 'Hello World' example) you
+ can draw on the popular shorthand syntax for string
+ output that comes handy in many cases
+ </para>
+ <programlisting>&hello1.rvt;</programlisting>
+ <para>
+ which is translated into
+ <programlisting>puts -nonewline "Hello World"</programlisting>
+ </para>
+ <para>
+ Unless you are printing a preformatted text within a <pre>...</pre>
+ structure, the lack or the presence of the newlines character usually
+ appended by terminal oriented output functions (such as
+ <command>puts</command>) doesn't mean anything in HTML. Nonetheless
+ having a fine control of line breakings leads to more efficient
+ HTML code, easy to read and analyze also with a simple text editor.
+ Imagine you need to dynamically print HTML attributes values in an
+ anchor tag
+ </para>
+ <programlisting><a href="<? puts -nonewline [::rivet::makeurl <replaceable>path_to_resource</replaceable>]?>">Hello link!</a></programlisting>
+ <para>
+ It is good to have the output printed inline. This is a
+ typical case where you can more conveniently use the shorthand notation
+ </para>
+ <programlisting><a href="<?= [::rivet::makeurl <replaceable>path_to_resource</replaceable>]?>">Hello link!</a></programlisting>
</example>
<example>
Modified: tcl/rivet/trunk/doc/xml/request.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/xml/request.xml?rev=1338639&r1=1338638&r2=1338639&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/xml/request.xml (original)
+++ tcl/rivet/trunk/doc/xml/request.xml Tue May 15 10:59:58 2012
@@ -218,8 +218,8 @@
<tr class="processing"><td>AfterScript</td><td>::</td></tr>
<tr class="processing"><td>AbortScript</td><td>::</td></tr>
<tr class="processing"><td>AfterEveryScript</td><td>::</td></tr>
- <tr class="childexit"><td>Child Exit</td><td>ChildExitScript</td><td>::</td></tr>
<tr class="processing"><td>Error Handling</td><td>ErrorScript</td><td>::</td></tr>
+ <tr class="childexit"><td>Child Termination</td><td>ChildExitScript</td><td>::</td></tr>
</tbody>
</table>
</simplesect>
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org