Commits

Greg Slepak committed 676b794

going back to previous directory structure, or rather, a similar one, so that it's simple to load the stuff in dragonfly-framework. the other way, though better organized, makes it difficult to know where the dragonfly-framework is without forcing the user to manually enter it in

  • Participants
  • Parent commits 463e41a

Comments (0)

Files changed (100)

+;;
+;; Dragonfly - a newLISP web framework
+;; Version 0.20
+;; 
+;;  Copyright (C) <2009>  <Marc Hildmann>
+;;
+;;  This program is free software: you can redistribute it and/or modify
+;;  it under the terms of the GNU General Public License as published by
+;;  the Free Software Foundation, either version 3 of the License, or
+;;  (at your option) any later version.
+;;
+;;  This program is distributed in the hope that it will be useful,
+;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;  GNU General Public License for more details.
+;;  You should have received a copy of the GNU General Public License
+;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;;
+;;
+;; Start this application on your localhost OS X
+;; newlisp -http -d PORT -w /Users/USERNAME/Sites/DIRECTORY &
+;;
+;; Open Your browser and type localhost:8080 - have FUN!
+;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+Version 0.20
+
+  * changed license from MIT to GNU (GPL v3)
+  * updated web.lsp to version 0.3.1 beta
+  * updated nldb.lsp (draft of 2009-09-11 20:42:48)
+  * added a directory "js"
+  * added the file "dragonfly.js" which includes some small javascripts which support the Dragonfly framework (AJAX, iPhone, Dragonfly Guide Menu)
+  * added the first AJAX function to Dragonfly: ajax-updater (check out the twitter demo)
+  * added a Dragonfly guide (it can be opened with /dragonfly_welcome/index)
+  * doing some tests with a new Listener (it's called listener2 in the dragonfly.lsp)
+  * trying to implement an image-helper for reading EXIF data from images
+  
+
+Version 0.19
+
+  * modified Dragonfly:view; now it displays an error view if a file is not found
+  * moved the constant "default404" into dragonfly_config.lsp
+  * added the function autoload-css; this function checks automatically for an iPhone and loads a different stylesheet
+
+
+Version 0.18
+
+  * added some functions to send HTTP headers - we don't use Web:send-headers anymore
+  * added HTTP Status Codes constants for Dragonfly:listener
+  * added a condition to Dragonfly:listener for sending correct XML-Headers
+  * added the action parameter to Dragonfly:link_to
+ 
+Version 0.17
+
+  * changed path to newLISP (/usr/bin/env newlisp) 
+  * added a config directory, so updating of Dragonfly would be easier now (we auto-load the config files ;)
+
+Version 0.16
+
+  * improved the directory structure: added three folders (dragonfly-framework, modules-active, modules-inactive)
+  * added an "auto-loader for modules" to Dragonfly: to load a module just put it into "modules-active", to NOT load a module put it into "modules-inactive"
+
+Version 0.15
+
+  * testing some ideas about custom routes
+
+Version 0.14
+
+  * removed the directory "actions" (it's now obsolet)
+  * renamed the directory "templates" into "views"
+  * renamed the function "Dragonfly:template" into "Dragonfly:view"
+  * added the constants "defaultview" and "defaultaction"
+  * added the constants "views-path" and "partials-path"
+  * added an improved version of Dragonfly:listener contributed by cormullion
+  * modified the .htaccess (also contributed by cormullion)
+  * improved the link_to function - it automatically checks if it can use .htaccess or not; it also uses the defaultaction now
+
+Version 0.13
+
+  * added a .htaccess to remove the question mark "?"
+  * bugfixing some paths after using mod_rewrite
+  * testing on nfshost.com
+
+Version 0.12
+
+  * renamed directory - it's called Dragonfly now
+  * thinking about a directory structure to handle multiple apps with one installation of Dragonfly
+  * added a memory calculation to benchmark function
+  * added a listener function
+  * removed the "case" functions in index.cgi for calling template - this work is now done by the listener
+  * did some bugfixing on the SQLite functions
+
+Version 0.11
+
+  * removed global flash notice
+  * removed start.bat and newlisp.exe
+
+Version 0.10
+
+  * added some function for SEO (I needed that at my work)
+  * I split up the css - there will be a separate dragonfly.css for some nice layouts
+  * added a benchmark function
+  * added the MIT License
+  * added a start.bat for easy start on Windows
+  * testing an idea about a global flash notice (doesn't work yet)
+
+
+Version 0.09
+
+  * some bugfixes
+  * added the function google-results-domain just for fun (the first time I use some regular expressions)
+  * added some features to the Dragonfly debug panel
+
+  * 29 downloads so far ... :-)
+   
+Version 0.08
+
+  * added a path to SQLite library for debian in module sqlite3.lsp ("/usr/lib/libsqlite3.so.0" ; Debian)
+
+Version 0.07
+
+  * added a twitter search with some nice css for speech bubbles
+  * added a demo template for twitter
+
+Version 0.06
+
+  * testing out the idea of partials in templates
+  * added a Dragonfly demo page
+
+Version 0.05
+
+  * added a sliding panel for debugging information
+  * extended the debugging information
+  * added functions for generating <script> and <rss> tags
+
+Version 0.04
+
+  * added a simple page-controller architecture in index.cgi
+  * generated a newLISP-Doc for Dragonfly.lsp in the module directory
+
+Version 0.03
+
+  * finalized the table generator functions, especially (table_data)
+
+Version 0.02
+
+  * added the functions (form_hidden),(form_textfield)
+  * playing around with nldb.lsp - but didn't really succeed
+
+Version 0.01
+
+  * opened a first template called "main.tpl"
+  * added the first functions (css),(meta),(time-now),(form_open),(form_submit),(form_close)

databases/blog.nldb

+(set 'nldb:tables '(entries))
+
+(set 'entries '(
+  	(ID Headline Date Text Author) 
+
+  	("1" "Hello World - Do You remember me?" "Donnerstag/Thursday &mdash; 30.07.2009 &mdash; 20:20" "After some experiments and a lot of time I finally decided to blog again. About newLISP and fun with programming, my own framework Dragonfly and some photographs I like.<br/><br/>" "Marc Hildmann") 
+  	("2" "Eingew&ouml;hnen - Future home" "Freitag/Friday &mdash; 31.07.2009 &mdash; 20:57" "Erste Gehversuche mit NearlyFreeSpeech.net. Schlichte, aber sehr durchdachte Oberfl&auml;che. Das wird wohl das neue Zuhause.</p><br/><p>First steps with NearlyFreeSpeech.net. I like their simple, but effective user interface. Seems to be the new home, so I just ordered marchildmann.com" "Marc Hildmann") 
+	("3" "Ein Umzug - A blog's procession" "Sonntag/Sunday &mdash; 02.08.2009 &mdash; 21:55" "Diese Webseite wird nun bei NearlyFreeSpeech.net gelagert und durch mein Dragonfly framework betrieben.</p><br/><p>This website is hosted by NearlyFreeSpeech.net and powered by my Dragonfly framework." "Marc Hildmann") 
+	("4" "Nominiert! - Nominated on Fotopedia" "Montag/Munday &mdash; 03.08.2009 &mdash; 20:32" "Eines meiner Fotos wurde auf www.fotopedia.com nominiert und ist nun Bestandteil des Hannover Albums. Gebt mir Eure Stimme - Danke! (http://www.fotopedia.com/albums/fotopedia-en-Hanover)</p><br/><p>One of my photos was nominated for Hanover. Vote for me on www.fotopedia.com - Thanks! Check out the other photos in the 'Hanover album'" "Marc Hildmann")
+	
+))
+

databases/main.sqlite

Binary file added.

dragonfly-framework/.htaccess

Empty file added.

dragonfly-framework/config/dragonfly_config.lsp

+;===============================================================================
+; !Defining new context
+;===============================================================================
+
+(context 'Dragonfly)
+
+; location of newlisp shared directory (for module support)
+(constant 'newlisp-dir "/usr/share/newlisp")
+
+; setting a defaultview
+(constant 'defaultview "dragonfly_welcome")
+; setting a defaultaction
+(constant 'defaultaction "index") ; display all
+; setting a default rss view
+(constant 'defaultrss "dragonfly_rssfeed")
+
+; setting a 404 view
+(constant 'default404 "404")
+
+
+(context Dragonfly)

dragonfly-framework/config/dragonfly_routes.lsp

+(context 'Dragonfly)
+
+; setting up some RESTful like definitions
+(constant 'create "create") ; return form for creating
+(constant 'show "show") ; show specific
+(constant 'edit "edit") ; return form for editing
+(constant 'update "update") ; update specific
+(constant 'remove "remove") ; delete specific
+
+
+(context Dragonfly)

dragonfly-framework/docs/dragonfly.lsp.html

+<!DOCTYPE HTML PUBLIC "HTML 4.01 Transitional">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>dragonfly.lsp</title>
+
+<link rel="stylesheet" type="text/css" href="newlispdoc.css" />
+</head>
+
+<body style="margin: 20px;" text="#111111" bgcolor="#FFFFFF" 
+			link="#376590" vlink="#551A8B" alink="#ffAA28">
+<blockquote>
+<center><h1>dragonfly.lsp</h1></center>
+<p><a href="index.html">Module index</a></p> Copyright (c) 2009 Marc Hildmann
+<br/><br/>
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+<br/><br/>
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+<a href="dragonfly.lsp.src.html">source</a><br/><br/><h2>Module:&nbsp;Dragonfly</h2><b>Author: </b>Marc Hildmann <marc.hildmann@gmail.com><br/>
+<b>Version: </b>0.12<br/>
+<b>Location: </b><a href="http://code.google.com/p/dragonfly-newlisp/">http://code.google.com/p/dragonfly-newlisp/</a><br/>
+<p>A newLISP web framework for rapid web development</p>
+<br/><br/>
+<br/><br/>
+ set constants for Dragonfly
+
+ init symbols for Dragonfly listener
+
+
+
+
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_listener"></a><h3><font color=#CC0000>Dragonfly:listener</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:listener</font>)</b><br/>
+ <p>The Dragonfly listener parses the QUERY STRING
+ for the specified template and action.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_benchmark-start"></a><h3><font color=#CC0000>Dragonfly:benchmark-start</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:benchmark-start</font>)</b><br/>
+ <p>Sets the start point for benchmarking.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_benchmark-end"></a><h3><font color=#CC0000>Dragonfly:benchmark-end</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:benchmark-end</font>)</b><br/>
+ <p>Sets the end point for benchmarking and calculates the result in milliseconds plus
+ some information about memory usage.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_debugging"></a><h3><font color=#CC0000>Dragonfly:debugging</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:debugging</font>)</b><br/>
+ <p>Writes some debug information to the screen. Requires Web.lsp module for POST and GET information.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_template"></a><h3><font color=#CC0000>Dragonfly:template</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:template</font> <em>template</em>)</b><br/>
+<b>parameter: </b><em>template</em> - name of template<br/>
+ <p>Evaluates the template and returns it.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_partial"></a><h3><font color=#CC0000>Dragonfly:partial</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:partial</font> <em>template</em>)</b><br/>
+<b>parameter: </b><em>template</em> - name of partial template<br/>
+ <p>Evaluates the partial template and returns it.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_css"></a><h3><font color=#CC0000>Dragonfly:css</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:css</font> <em>css-media</em> <em>css-location</em>)</b><br/>
+<b>parameter: </b><em>css-media</em> - a string containing screen or print<br/>
+<b>parameter: </b><em>css-location</em> - the location of your stylesheet<br/>
+ <p>Writes a standard stylesheet HTML tag.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_meta"></a><h3><font color=#CC0000>Dragonfly:meta</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:meta</font> <em>meta-name</em> <em>meta-content</em>)</b><br/>
+<b>parameter: </b><em>meta-name</em> - a string containing the meta-name<br/>
+<b>parameter: </b><em>meta-content</em> - a string containing the meta content<br/>
+ <p>Writes a standard meta HTML tag.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_rss"></a><h3><font color=#CC0000>Dragonfly:rss</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:rss</font> <em>rss-title</em> <em>rss-location</em>)</b><br/>
+<b>parameter: </b><em>rss-title</em> - a string containing the rss title<br/>
+<b>parameter: </b><em>rss-location</em> - a string containing the rss location<br/>
+ <p>Writes a standard RSS HTML tag.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_script"></a><h3><font color=#CC0000>Dragonfly:script</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:script</font> <em>script-location</em>)</b><br/>
+<b>parameter: </b><em>script-location</em> - a string containing the script location<br/>
+ <p>Writes a standard script HTML tag.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_meta-iphone"></a><h3><font color=#CC0000>Dragonfly:meta-iphone</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:meta-iphone</font>)</b><br/>
+ <p>Detects the iPhone and writes an apropiate META tag.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_compare-lists"></a><h3><font color=#CC0000>Dragonfly:compare-lists</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:compare-lists</font> <em>list1</em> <em>list2</em>)</b><br/>
+<b>parameter: </b><em>list1</em> - list number 1<br/>
+<b>parameter: </b><em>list2</em> - list number 2<br/>
+ <p>Compares two lists and return the score of same and same position. This is a function by cormullion.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_google-analytics"></a><h3><font color=#CC0000>Dragonfly:google-analytics</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:google-analytics</font> <em>analytics-id</em>)</b><br/>
+<b>parameter: </b><em>analytics-id</em> - enter the specified id provided by Google Analytics, e.g. UA-123456-7<br/>
+ <p>Writes the Google Analytics tracking code.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_todays-date-german"></a><h3><font color=#CC0000>Dragonfly:todays-date-german</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:todays-date-german</font> including actual time)</b><br/>
+ <p>Writes todays date including time in german localization</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_time-now"></a><h3><font color=#CC0000>Dragonfly:time-now</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:time-now</font>)</b><br/>
+ <p>Writes the actual time</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_image"></a><h3><font color=#CC0000>Dragonfly:image</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:image</font> <em>image_name</em> <em>image_url</em>, <em>options</em>)</b><br/>
+<b>parameter: </b><em>image_name</em> - a string containing the image alternative title<br/>
+<b>parameter: </b><em>image_url</em> - a string containing the url<br/>
+<b>parameter: </b><em>options</em> - optional settings like class, rel, width, height ...<br/>
+ <p>Writes a standard HTML image.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_link_to"></a><h3><font color=#CC0000>Dragonfly:link_to</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:link_to</font> <em>link_name</em> <em>link_url</em>)</b><br/>
+<b>parameter: </b><em>link_name</em> - a string containing the link's name<br/>
+<b>parameter: </b><em>link_url</em> - a string containing the url<br/>
+ <p>Writes a standard HTML link</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_link_mailto"></a><h3><font color=#CC0000>Dragonfly:link_mailto</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:link_mailto</font> <em>link_name</em> <em>options</em>)</b><br/>
+<b>parameter: </b><em>name</em> - a string containing the link's name<br/>
+<b>parameter: </b><em>options</em> - a string containing the url<br/>
+ <p>Writes a standard HTML mailto link</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_form_open"></a><h3><font color=#CC0000>Dragonfly:form_open</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:form_open</font> <em>form_action</em> <form_method)</b><br/>
+<b>parameter: </b><em>name</em> - a string containing the form action<br/>
+<b>parameter: </b><em>name</em> - a string containing the form submit method POST/GET<br/>
+ <p>Writes a standard form open element</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_form_textfield"></a><h3><font color=#CC0000>Dragonfly:form_textfield</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:form_textfield</font> <em>form_name</em>)</b><br/>
+<b>parameter: </b><em>name</em> - a string containing the text field name<br/>
+ <p>Writes a standard form field with size <tt>30</tt></p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_form_submit"></a><h3><font color=#CC0000>Dragonfly:form_submit</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:form_submit</font> <em>form_value</em>)</b><br/>
+<b>parameter: </b><em>value</em> - a string containing the value for the submit button<br/>
+ <p>Writes a standard form submit button.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_form_hidden"></a><h3><font color=#CC0000>Dragonfly:form_hidden</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:form_hidden</font> <em>form_name</em> <em>form_value</em>)</b><br/>
+<b>parameter: </b><em>form_name</em> - a string containing the name for the hidden field<br/>
+<b>parameter: </b><em>form_value</em> - a string containing the value for the hidden field<br/>
+ <p>Writes a standard form hidden field.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_form_close"></a><h3><font color=#CC0000>Dragonfly:form_close</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:form_close</font>)</b><br/>
+ <p>Writes a form close tag</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_form_generate-from-columns"></a><h3><font color=#CC0000>Dragonfly:form_generate-from-columns</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:form_generate-from-columns</font> <em>tablename</em>)</b><br/>
+ <p>Generates a form including input field from the given table.
+ The form uses POST Method and refers to itself. It includes one hidden
+ field called dragonfly_form, to detect form submit.
+ </p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_table_open"></a><h3><font color=#CC0000>Dragonfly:table_open</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:table_open</font> <em>head_elements</em>)</b><br/>
+<b>parameter: </b><em>head_elements</em> - a list containing the table head<br/>
+ <p>Writes a standard table open element including a head, generated from a list.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_table_data"></a><h3><font color=#CC0000>Dragonfly:table_data</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:table_data</font> <em>table_elements</em>)</b><br/>
+<b>parameter: </b><em>table_elements</em> - a list containing all table elements (row by row, from left to right), including empty cells<br/>
+ <p>Writes the table data generated from a list.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_table_footer"></a><h3><font color=#CC0000>Dragonfly:table_footer</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:table_footer</font> <em>table_footer_text</em>)</b><br/>
+<b>parameter: </b><em>table_footer_text</em> - a string containing the table footer text<br/>
+ <p>Writes a standard table footer with number of colspan generated from the last table-head.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_table_close"></a><h3><font color=#CC0000>Dragonfly:table_close</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:table_close</font>)</b><br/>
+ <p>Writes a standard table close element.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_show-database"></a><h3><font color=#CC0000>Dragonfly:show-database</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:show-database</font>)</b><br/>
+ <p>Writes some information about the currently used nldb</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_sqlite-open"></a><h3><font color=#CC0000>Dragonfly:sqlite-open</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:sqlite-open</font> <em>databasename</em>)</b><br/>
+<b>parameter: </b><em>databasename</em> - string containing the database name<br/>
+ <p>Open the SQLite database or creates it, if it does not exist.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_sqlite-tables"></a><h3><font color=#CC0000>Dragonfly:sqlite-tables</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:sqlite-tables</font>)</b><br/>
+ <p>Shows the existing tables in the current database.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_sqlite-columns"></a><h3><font color=#CC0000>Dragonfly:sqlite-columns</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:sqlite-columns</font>)</b><br/>
+ <p>Shows the existing columns in a given table.</p>
+<br/><br/>
+<br/><br/><center>- &sect; -</center><br/>
+<a name="Dragonfly_twitter-search"></a><h3><font color=#CC0000>Dragonfly:twitter-search</font></h3>
+<b>syntax: (<font color=#CC0000>Dragonfly:twitter-search</font> <em>keyword</em>)</b><br/>
+<b>parameter: </b><em>keyword</em> - string containing the keyword for search<br/>
+ <p>Writes the results of the search in nice speech bubbles.</p>
+<br/><br/>
+
+<br/><br/><center>- &part; -</center><br/>
+<center><font face='Arial' size='-2' color='#444444'>
+generated with <a href="http://newlisp.org">newLISP</a>&nbsp;
+and <a href="http://newlisp.org/newLISPdoc.html">newLISPdoc</a>
+</font></center>
+</blockquote>
+</body>
+</html>

dragonfly-framework/docs/dragonfly.lsp.src.html

+<!DOCTYPE HTML PUBLIC "4.01 Transitional"><html><title>Dragonfly</title><body><pre>
+<font color='#555555'>;; Copyright (c) 2009 Marc Hildmann</font>
+<font color='#555555'>;;</font>
+<font color='#555555'>;; Permission is hereby granted, free of charge, to any person obtaining</font>
+<font color='#555555'>;; a copy of this software and associated documentation files (the</font>
+<font color='#555555'>;; "Software"), to deal in the Software without restriction, including</font>
+<font color='#555555'>;; without limitation the rights to use, copy, modify, merge, publish,</font>
+<font color='#555555'>;; distribute, sublicense, and/or sell copies of the Software, and to</font>
+<font color='#555555'>;; permit persons to whom the Software is furnished to do so, subject to</font>
+<font color='#555555'>;; the following conditions:</font>
+<font color='#555555'>;;</font>
+<font color='#555555'>;; The above copyright notice and this permission notice shall be</font>
+<font color='#555555'>;; included in all copies or substantial portions of the Software.</font>
+
+<font color='#555555'>;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,</font>
+<font color='#555555'>;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</font>
+<font color='#555555'>;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</font>
+<font color='#555555'>;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE</font>
+<font color='#555555'>;; LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION</font>
+<font color='#555555'>;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</font>
+<font color='#555555'>;; WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</font>
+
+<font color='#555555'>#!/usr/bin/newlisp</font>
+
+<font color='#555555'>;; <font color='#308080'>@module</font> Dragonfly</font>
+<font color='#555555'>;; <font color='#308080'>@author</font> Marc Hildmann &lt;marc.hildmann@gmail.com&gt;</font>
+<font color='#555555'>;; <font color='#308080'>@version</font> 0.12</font>
+<font color='#555555'>;; <font color='#308080'>@location</font> http://code.google.com/p/dragonfly-newlisp/</font>
+<font color='#555555'>;; <font color='#308080'>@description</font> A newLISP web framework for rapid web development</font>
+<font color='#555555'>;; </font>
+<font color='#555555'>;;</font>
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !Loading used modules and defining new context</font>
+<font color='#555555'>;===============================================================================</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>load</font> <font color='#008800'>"./modules/sqlite3.lsp"</font><font color='#AA0000'>)</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>context</font> 'Dragonfly<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; set constants for Dragonfly</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>constant</font> 'documentroot <font color='#AA0000'>(</font><font color='#0000AA'>env</font> <font color='#008800'>"DOCUMENT_ROOT"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>constant</font> 'host <font color='#AA0000'>(</font><font color='#0000AA'>env</font> <font color='#008800'>"HTTP_HOST"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>constant</font> 'useragent <font color='#AA0000'>(</font><font color='#0000AA'>env</font> <font color='#008800'>"HTTP_USER_AGENT"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>constant</font> 'server <font color='#AA0000'>(</font><font color='#0000AA'>env</font> <font color='#008800'>"SERVER_SOFTWARE"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>constant</font> 'programfiles <font color='#AA0000'>(</font><font color='#0000AA'>env</font> <font color='#008800'>"PROGRAMFILES"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>constant</font> 'proxy <font color='#AA0000'>(</font><font color='#0000AA'>env</font> <font color='#008800'>"HTTP_PROXY"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+
+<font color='#555555'>;; init symbols for Dragonfly listener</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'templatename <font color='#008800'>""</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'action <font color='#008800'>""</font><font color='#AA0000'>)</font>
+
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !Base Functions</font>
+<font color='#555555'>;===============================================================================</font>
+
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:listener)</font>
+<font color='#555555'>;; &lt;p&gt;The Dragonfly listener parses the QUERY STRING</font>
+<font color='#555555'>;; for the specified template and action.&lt;/p&gt;</font>
+<font color='#555555'>;;</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>listener<font color='#AA0000'>)</font>	
+
+		<font color='#555555'>;; output HTML header</font>
+		<font color='#AA0000'>(</font>Web:header <font color='#008800'>"Content-Type"</font> <font color='#008800'>"text/html"</font><font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font>Web:send-headers<font color='#AA0000'>)</font>
+		
+		<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'>empty?</font> <font color='#AA0000'>(</font><font color='#0000AA'>env</font> <font color='#008800'>"QUERY_STRING"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+			<font color='#555555'>;; if there is no query show default template		</font>
+			<font color='#AA0000'>(</font>Dragonfly:template <font color='#008800'>"welcome"</font><font color='#AA0000'>)</font>				
+		<font color='#AA0000'>)</font> 
+			
+		<font color='#555555'>;; else there must be a string which we'll parse	</font>
+		<font color='#555555'>;; Regex for parsing templatename and action</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>constant</font> 'regex-querystring <font color='#008800'>"(.*)/(.*)"</font><font color='#AA0000'>)</font>			
+		<font color='#AA0000'>(</font><font color='#0000AA'>regex</font> regex-querystring <font color='#AA0000'>(</font><font color='#0000AA'>env</font> <font color='#008800'>"QUERY_STRING"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'templatename $1<font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'action $2<font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font>Dragonfly:template templatename<font color='#AA0000'>)</font>										
+			
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:benchmark-start)</font>
+<font color='#555555'>;; &lt;p&gt;Sets the start point for benchmarking.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>benchmark-start<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'microtime-start <font color='#AA0000'>(</font><font color='#0000AA'>time-of-day</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:benchmark-end)</font>
+<font color='#555555'>;; &lt;p&gt;Sets the end point for benchmarking and calculates the result in milliseconds plus</font>
+<font color='#555555'>;; some information about memory usage.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>benchmark-result<font color='#AA0000'>)</font>
+
+  	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_cells_bytes <font color='#AA0000'>(</font><font color='#0000AA'>*</font> <font color='#AA0000'>(</font><font color='#0000AA'>sys-info</font> <font color='#665500'>0</font><font color='#AA0000'>)</font> <font color='#665500'>16</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_cells_kilobytes <font color='#AA0000'>(</font><font color='#0000AA'>/</font> mem_cells_bytes <font color='#665500'>1024</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+
+  	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_cells-constant_bytes <font color='#AA0000'>(</font><font color='#0000AA'>*</font> <font color='#AA0000'>(</font><font color='#0000AA'>sys-info</font> <font color='#665500'>1</font><font color='#AA0000'>)</font> <font color='#665500'>16</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_cells-constant_kilobytes <font color='#AA0000'>(</font><font color='#0000AA'>/</font> mem_cells-constant_bytes <font color='#665500'>1024</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_cells-constant_megabytes <font color='#AA0000'>(</font><font color='#0000AA'>/</font> mem_cells-constant_kilobytes <font color='#665500'>1024</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+
+  	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_symbols_bytes <font color='#AA0000'>(</font><font color='#0000AA'>*</font> <font color='#AA0000'>(</font><font color='#0000AA'>sys-info</font> <font color='#665500'>2</font><font color='#AA0000'>)</font> <font color='#665500'>32</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_symbols_kilobytes <font color='#AA0000'>(</font><font color='#0000AA'>/</font> mem_symbols_bytes <font color='#665500'>1024</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+
+    <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_total_usage <font color='#AA0000'>(</font><font color='#0000AA'>+</font> mem_cells_kilobytes mem_symbols_kilobytes<font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'microtime-end <font color='#AA0000'>(</font><font color='#0000AA'>time-of-day</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'execution-time-milliseconds <font color='#AA0000'>(</font><font color='#0000AA'>-</font> microtime-end microtime-start<font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'execution-time-seconds <font color='#AA0000'>(</font><font color='#0000AA'>div</font> execution-time-milliseconds <font color='#665500'>1000</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"&lt;div id='dragonfly_benchmark'>Rendered in "</font>execution-time-milliseconds<font color='#008800'>" milliseconds. Used "</font>mem_total_usage<font color='#008800'>" KB.&lt;br/&gt;&lt;div id='dragonfly_logo'>&lt;a href='http://code.google.com/p/dragonfly-newlisp/'>&amp;mdash&#059;()o Dragonfly &lt;span class='dragonfly_uppercase'>web framework&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:debugging)</font>
+<font color='#555555'>;; &lt;p&gt;Writes some debug information to the screen. Requires Web.lsp module for POST and GET information.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>debugging<font color='#AA0000'>)</font>
+
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_cells_bytes <font color='#AA0000'>(</font><font color='#0000AA'>*</font> <font color='#AA0000'>(</font><font color='#0000AA'>sys-info</font> <font color='#665500'>0</font><font color='#AA0000'>)</font> <font color='#665500'>16</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_cells_kilobytes <font color='#AA0000'>(</font><font color='#0000AA'>/</font> mem_cells_bytes <font color='#665500'>1024</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_cells-constant_bytes <font color='#AA0000'>(</font><font color='#0000AA'>*</font> <font color='#AA0000'>(</font><font color='#0000AA'>sys-info</font> <font color='#665500'>1</font><font color='#AA0000'>)</font> <font color='#665500'>16</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_cells-constant_kilobytes <font color='#AA0000'>(</font><font color='#0000AA'>/</font> mem_cells-constant_bytes <font color='#665500'>1024</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_cells-constant_megabytes <font color='#AA0000'>(</font><font color='#0000AA'>/</font> mem_cells-constant_kilobytes <font color='#665500'>1024</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_symbols_bytes <font color='#AA0000'>(</font><font color='#0000AA'>*</font> <font color='#AA0000'>(</font><font color='#0000AA'>sys-info</font> <font color='#665500'>2</font><font color='#AA0000'>)</font> <font color='#665500'>32</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_symbols_kilobytes <font color='#AA0000'>(</font><font color='#0000AA'>/</font> mem_symbols_bytes <font color='#665500'>1024</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'mem_total_usage <font color='#AA0000'>(</font><font color='#0000AA'>+</font> mem_cells_kilobytes mem_symbols_kilobytes<font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+
+
+
+  <font color='#AA0000'>(</font><font color='#0000AA'>println</font> "
+	&lt;div id='dragonfly_debug' style='border:1px dotted #00aeef<font color='#555555'>; width:700px; padding:8px; margin-top:20px;' ></font>
+	&lt;h2&gt;Dragonfly DEBUG information&lt;/h2&gt;
+	&lt;h3&gt;HOST&lt;/h3&gt;<font color='#008800'>"host"</font>
+	&lt;h3&gt;DOCUMENT ROOT&lt;/h3&gt;<font color='#008800'>"documentroot"</font>
+	&lt;h3&gt;Windows Programfiles&lt;/h3&gt;<font color='#008800'>"programfiles"</font>
+	&lt;h3&gt;QUERY&lt;/h3&gt;<font color='#008800'>"(env "</font>QUERY_STRING<font color='#008800'>")"</font>
+	&lt;h3&gt;TEMPLATENAME&lt;/h3&gt;<font color='#008800'>"templatename"</font>
+	&lt;h3&gt;ACTION&lt;/h3&gt;<font color='#008800'>"action"</font>
+	&lt;h3&gt;USER-AGENT&lt;/h3&gt;<font color='#008800'>"useragent"</font>
+	&lt;h3&gt;Proxy&lt;/h3&gt;<font color='#008800'>"proxy"</font>
+	&lt;h3&gt;SERVER&lt;/h3&gt;<font color='#008800'>"server"</font>
+	&lt;h3&gt;POST&lt;/h3&gt;<font color='#008800'>"Web:POST"</font>
+	&lt;h3&gt;GET&lt;/h3&gt;<font color='#008800'>"Web:GET"</font>
+	&lt;h3&gt;System information&lt;/h3&gt;
+	&lt;ul&gt;
+		&lt;li&gt;Total memory usage: <font color='#008800'>"mem_total_usage"</font> KB&lt;/li&gt;	
+		&lt;li&gt;Number of Lisp Cells <font color='#AA0000'>(</font><font color='#665500'>16</font> bytes per cell<font color='#AA0000'>)</font><font color='#0000AA'>:</font> <font color='#008800'>"(sys-info 0)"</font>&lt;/li&gt;
+		&lt;li&gt;Memory used by Lisp Cells: <font color='#008800'>"mem_cells_kilobytes"</font> KB&lt;/li&gt;
+		&lt;li&gt;Maximum number of Lisp cells constant: <font color='#008800'>"(sys-info 1)"</font>&lt;/li&gt;
+		&lt;li&gt;Maximum memory used by Lisp cells constant: <font color='#008800'>"mem_cells-constant_megabytes"</font> MB&lt;/li&gt;
+		&lt;li&gt;Number of <font color='#0000AA'>symbols</font> <font color='#AA0000'>(</font><font color='#665500'>32</font> bytes per symbol<font color='#AA0000'>)</font><font color='#0000AA'>:</font> <font color='#008800'>"(sys-info 2)"</font>&lt;/li&gt;
+		&lt;li&gt;Memory used by symbols: <font color='#008800'>"mem_symbols_kilobytes"</font> KB&lt;/li&gt;
+		&lt;li&gt;Evaluation/recursion level: <font color='#008800'>"(sys-info 3)"</font>&lt;/li&gt;
+		&lt;li&gt;Environment stack level: <font color='#008800'>"(sys-info 4)"</font>&lt;/li&gt;
+		&lt;li&gt;Maximum call stack constant: <font color='#008800'>"(sys-info 5)"</font>&lt;/li&gt;
+		&lt;li&gt;Pid of running newLISP process: <font color='#008800'>"(sys-info 6)"</font>&lt;/li&gt;
+		&lt;li&gt;Version number as an <font color='#0000AA'>integer</font> constant: <font color='#008800'>"(sys-info 7)"</font>&lt;/li&gt;
+		&lt;li&gt;Operating system constant: <font color='#008800'>"(sys-info 8)"</font>&lt;/li&gt;
+		&lt;li&gt;Used <font color='#0000AA'>symbols</font> in Dragonfly: &lt;pre&gt;<font color='#008800'>"(symbols 'Dragonfly)"</font>&lt;/pre&gt;&lt;/li&gt;
+		&lt;li&gt;Last system error: <font color='#008800'>"(sys-error)"</font>&lt;/li&gt;
+	&lt;/ul&gt;
+	
+	&lt;/div&gt;"<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:template &lt;template&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;template&gt; name of template</font>
+<font color='#555555'>;; &lt;p&gt;Evaluates the template and returns it.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>template template<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'path-to-templates <font color='#008800'>"./templates/"</font><font color='#AA0000'>)</font>	
+	<font color='#555555'>;;(println path-to-templates)</font>
+  	<font color='#AA0000'>(</font><font color='#0000AA'>push</font> template path-to-templates <font color='#665500'>-1</font><font color='#AA0000'>)</font>
+  	<font color='#AA0000'>(</font>Web:eval-template <font color='#AA0000'>(</font><font color='#0000AA'>read-file</font> path-to-templates<font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:partial &lt;template&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;template&gt; name of partial template</font>
+<font color='#555555'>;; &lt;p&gt;Evaluates the partial template and returns it.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>partial template<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'path-to-partials <font color='#008800'>"./templates/partials/"</font><font color='#AA0000'>)</font>	
+  	<font color='#AA0000'>(</font><font color='#0000AA'>push</font> template path-to-partials <font color='#665500'>-1</font><font color='#AA0000'>)</font>
+  	<font color='#AA0000'>(</font>Web:eval-template <font color='#AA0000'>(</font><font color='#0000AA'>read-file</font> path-to-partials<font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:css &lt;css-media&gt; &lt;css-location&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;css-media&gt; a string containing screen or print</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;css-location&gt; the location of your stylesheet</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard stylesheet HTML tag.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>css css-media css-location<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;link rel='stylesheet' type='text/css' media='"</font>css-media<font color='#008800'>"' href='"</font>css-location<font color='#008800'>"' /&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:meta &lt;meta-name&gt; &lt;meta-content&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;meta-name&gt; a string containing the meta-name</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;meta-content&gt; a string containing the meta content</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard meta HTML tag.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>meta meta-name meta-content<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;meta name='"</font>meta-name<font color='#008800'>"' content='"</font>meta-content<font color='#008800'>"' /&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:rss &lt;rss-title&gt; &lt;rss-location&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;rss-title&gt; a string containing the rss title</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;rss-location&gt; a string containing the rss location</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard RSS HTML tag.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>rss rss-title rss-location<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;link rel='alternate' type='application/rss+xml' title='"</font>rss-title<font color='#008800'>"' href='"</font>rss-location<font color='#008800'>"' /&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:script &lt;script-location&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;script-location&gt; a string containing the script location</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard script HTML tag.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>script script-location<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;script type='text/javascript' src='"</font>script-location<font color='#008800'>"'>&lt;/script&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:meta-iphone)</font>
+<font color='#555555'>;; &lt;p&gt;Detects the iPhone and writes an apropiate META tag.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>meta-iphone<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;meta name='viewport' content='width=320, user-scalable=no' /&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:compare-lists &lt;list1&gt; &lt;list2&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;list1&gt; list number 1</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;list2&gt; list number 2</font>
+<font color='#555555'>;; &lt;p&gt;Compares two lists and return the score of same and same position. This is a function by cormullion.&lt;/p&gt;</font>
+<font color='#555555'>;;</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>compare-lists list1 list2<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"Comparing "</font> list1 <font color='#008800'>" and "</font> list2 <font color='#008800'>" ..."</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>" "</font><font color='#AA0000'>(</font><font color='#0000AA'>first</font> <font color='#AA0000'>(</font><font color='#0000AA'>count</font> '<font color='#AA0000'>(</font><font color='#0000AA'>true</font><font color='#AA0000'>)</font> <font color='#AA0000'>(</font><font color='#0000AA'>map</font> <font color='#0000AA'>=</font> list1 list2<font color='#AA0000'>)</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font> <font color='#008800'>" elements are the same and in the same position."</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:google-analytics &lt;analytics-id&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;analytics-id&gt; enter the specified id provided by Google Analytics, e.g. UA-123456-7</font>
+<font color='#555555'>;; &lt;p&gt;Writes the Google Analytics tracking code.&lt;/p&gt;</font>
+<font color='#555555'>;;</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>google-analytics analytics-id<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>print</font> "
+	&lt;script type=&#092;&#034;text/javascript&#092;&#034;>
+		var gaJsHost <font color='#0000AA'>=</font> <font color='#AA0000'>(</font><font color='#AA0000'>(</font>&#092;&#034;https:&#092;&#034; == document.location.protocol<font color='#AA0000'>)</font> ? &#092;&#034;https://ssl.&#092;&#034; <font color='#0000AA'>:</font> &#092;&#034;http://www.&#092;&#034;<font color='#AA0000'>)</font><font color='#555555'>;</font>
+		document.write<font color='#AA0000'>(</font>unescape<font color='#AA0000'>(</font>&#092;&#034;%3Cscript src='&#092;&#034; <font color='#0000AA'>+</font> gaJsHost <font color='#0000AA'>+</font> &#092;&#034;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&#092;&#034;<font color='#AA0000'>)</font><font color='#AA0000'>)</font><font color='#555555'>;</font>
+		&lt;/script&gt;
+		&lt;script type=&#092;&#034;text/javascript&#092;&#034;>
+		try {
+			var pageTracker <font color='#0000AA'>=</font> _gat._getTracker<font color='#AA0000'>(</font>&#092;&#034;<font color='#008800'>"analytics-id"</font>&#092;&#034;<font color='#AA0000'>)</font><font color='#555555'>;</font>
+			pageTracker._trackPageview<font color='#AA0000'>(</font><font color='#AA0000'>)</font><font color='#555555'>;</font>
+		} <font color='#0000AA'>catch</font><font color='#AA0000'>(</font>err<font color='#AA0000'>)</font> <font color='#008800'>{}</font>
+	&lt;/script&gt;				
+	"<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !Date Functions</font>
+<font color='#555555'>;===============================================================================</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:todays-date-german including actual time)</font>
+<font color='#555555'>;; &lt;p&gt;Writes todays date including time in german localization&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>todays-date-german<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>set-locale</font> <font color='#008800'>"de_DE"</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#AA0000'>(</font><font color='#0000AA'>date</font> <font color='#AA0000'>(</font><font color='#0000AA'>date-value</font><font color='#AA0000'>)</font> <font color='#665500'>0</font> <font color='#008800'>"%A, den %d. %B %Y um %H:%M:%S Uhr"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:time-now)</font>
+<font color='#555555'>;; &lt;p&gt;Writes the actual time&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>time-now<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#AA0000'>(</font><font color='#0000AA'>date</font> <font color='#AA0000'>(</font><font color='#0000AA'>date-value</font><font color='#AA0000'>)</font> <font color='#665500'>0</font> <font color='#008800'>"%H:%M:%S"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !Image Functions</font>
+<font color='#555555'>;===============================================================================</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:image &lt;image_name&gt; &lt;image_url&gt;, &lt;options&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;image_name&gt; a string containing the image alternative title</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;image_url&gt; a string containing the url</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;options&gt; optional settings like class, rel, width, height ...</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard HTML image.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>image image-name image-url, image-options<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;img src='"</font>image-url<font color='#008800'>"' alt='"</font>image-name<font color='#008800'>"' title='"</font>image-name<font color='#008800'>"' border='0' "</font>image-options<font color='#008800'>" /&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !Link Functions</font>
+<font color='#555555'>;===============================================================================</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:link_to &lt;link_name&gt; &lt;link_url&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;link_name&gt; a string containing the link's name</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;link_url&gt; a string containing the url</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard HTML link&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>link_to link-name link-url<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;a href='"</font>link-url<font color='#008800'>"'>"</font>link-name<font color='#008800'>"&lt;/a&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:link_mailto &lt;link_name&gt; &lt;options&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;name&gt; a string containing the link's name</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;options&gt; a string containing the url</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard HTML mailto link&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>link_mailto link-name link-url<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;a href='mailto:"</font>link-url<font color='#008800'>"'>"</font>link-name<font color='#008800'>"&lt;/a&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !Form Functions</font>
+<font color='#555555'>;===============================================================================</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:form_open &lt;form_action&gt; &lt;form_method)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;name&gt; a string containing the form action</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;name&gt; a string containing the form submit method POST/GET</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard form open element&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>form-open form_action form_method<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;table&gt;&lt;form action='"</font>form_action<font color='#008800'>"' method='"</font>form_method<font color='#008800'>"'>"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:form_textfield &lt;form_name&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;name&gt; a string containing the text field name</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard form field with size '30'&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>form-textfield form_name<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;tr class='form_row'>&lt;td class='form_label'>&lt;label for='"</font>form_name<font color='#008800'>"'>"</font><font color='#AA0000'>(</font><font color='#0000AA'>title-case</font> form_name<font color='#AA0000'>)</font><font color='#008800'>"&lt;/label&gt;&lt;/td&gt;&lt;td class='form_input'>&lt;input id='"</font>form_name<font color='#008800'>"' name='"</font>form_name<font color='#008800'>"' size='30' type='text' /&gt;&lt;/td&gt;&lt;/tr&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:form_submit &lt;form_value&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;value&gt; a string containing the value for the submit button</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard form submit button.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>form-submit form_value<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;tr class='form_row'>&lt;td class='form_label'>&amp;nbsp&#059;&lt;/td&gt;&lt;td class='form_input'>&lt;input id='commit' type='submit' value='"</font>form_value<font color='#008800'>"' /&gt;&lt;/td&gt;&lt;/tr&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:form_hidden &lt;form_name&gt; &lt;form_value&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;form_name&gt; a string containing the name for the hidden field</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;form_value&gt; a string containing the value for the hidden field</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard form hidden field.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>form-hidden form_name form_value<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;input type='hidden' name='"</font>form_name<font color='#008800'>"' value='"</font>form_value<font color='#008800'>"' /&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:form_close)</font>
+<font color='#555555'>;; &lt;p&gt;Writes a form close tag&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>form-close<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;/form&gt;&lt;/table&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:form_generate-from-columns &lt;tablename&gt;)</font>
+<font color='#555555'>;; &lt;p&gt;Generates a form including input field from the given table.</font>
+<font color='#555555'>;; The form uses POST Method and refers to itself. It includes one hidden</font>
+<font color='#555555'>;; field called dragonfly_form, to detect form submit.</font>
+<font color='#555555'>;; &lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>form-generate-from-columns table<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'columns <font color='#AA0000'>(</font>sql3:columns table<font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;table&gt;&lt;form id='form_"</font>table<font color='#008800'>"' action='./?"</font>templatename<font color='#008800'>"/"</font>find<font color='#008800'>"' method='POST'>"</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>dolist</font> <font color='#AA0000'>(</font>column_name columns<font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;tr class='form_row'>&lt;td class='form_label'>&lt;label for='"</font>column_name<font color='#008800'>"'>"</font><font color='#AA0000'>(</font><font color='#0000AA'>title-case</font> column_name<font color='#AA0000'>)</font><font color='#008800'>"&lt;/label&gt;&lt;/td&gt;&lt;td class='form_input'>&lt;input id='"</font>column_name<font color='#008800'>"' name='"</font>column_name<font color='#008800'>"' size='30' type='text' /&gt;&lt;/td&gt;&lt;/tr&gt;"</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;tr class='form_row'>&lt;td class='form_label'>&amp;nbsp&#059;&lt;/td&gt;&lt;td class='form_input'>&lt;input id='form_submit' type='submit' name='commit' value='Add' /&gt;&lt;/td&gt;&lt;/tr&gt;"</font><font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;input type='hidden' name='databasetable' value='"</font>table<font color='#008800'>"' /&gt;"</font><font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;/form&gt;&lt;/table&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !Table Functions</font>
+<font color='#555555'>;===============================================================================</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:table_open &lt;head_elements&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;head_elements&gt; a list containing the table head</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard table open element including a head, generated from a list.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>table_open table_head_elements<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'table_colspan table_head_elements<font color='#AA0000'>)</font> <font color='#555555'>;count of table_head_elements for defining a correct table-colspan</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> "
+	&lt;!-- BEGIN table -->
+	&lt;table&gt;
+	&lt;thead&gt;&lt;tr&gt;"
+		<font color='#AA0000'>(</font><font color='#0000AA'>dolist</font> <font color='#AA0000'>(</font>th-element table_head_elements<font color='#AA0000'>)</font>
+			<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'>=</font> $idx <font color='#665500'>0</font><font color='#AA0000'>)</font> <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;th class='table_firstcolumn'>"</font>th-element<font color='#008800'>"&lt;/th&gt;"</font><font color='#AA0000'>)</font> <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;th&gt;"</font>th-element<font color='#008800'>"&lt;/th&gt;"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+		<font color='#AA0000'>)</font>
+	<font color='#008800'>"&lt;/tr&gt;&lt;/thead&gt;"</font>
+  <font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:table_data &lt;table_elements&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;table_elements&gt; a list containing all table elements (row by row, from left to right), including empty cells</font>
+<font color='#555555'>;; &lt;p&gt;Writes the table data generated from a list.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>table_data table_elements<font color='#AA0000'>)</font>
+	<font color='#555555'>; initialize maximum length per row with offset -1, because counting starts at "0"	</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'rowlength <font color='#AA0000'>(</font><font color='#0000AA'>length</font> table_colspan<font color='#AA0000'>)</font><font color='#AA0000'>)</font>	
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'rowlength <font color='#AA0000'>(</font><font color='#0000AA'>-</font> rowlength <font color='#665500'>1</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;tbody&gt;"</font>
+			<font color='#AA0000'>(</font><font color='#0000AA'>dotimes</font> <font color='#AA0000'>(</font>i <font color='#665500'>1</font><font color='#AA0000'>)</font>
+				<font color='#AA0000'>(</font><font color='#0000AA'>dolist</font> <font color='#AA0000'>(</font>td-element table_elements<font color='#AA0000'>)</font>
+					<font color='#555555'>; here we do some modulo calculation to determine if a new row begins</font>
+					<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'>=</font> <font color='#AA0000'>(</font><font color='#0000AA'>mod</font> $idx <font color='#AA0000'>(</font><font color='#0000AA'>length</font> table_colspan<font color='#AA0000'>)</font><font color='#AA0000'>)</font> <font color='#665500'>0</font><font color='#AA0000'>)</font> <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;tr&gt;&lt;td class='table_firstcolumn'>"</font>td-element<font color='#008800'>"&lt;/td&gt;"</font><font color='#AA0000'>)</font> <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;td&gt;"</font>td-element<font color='#008800'>"&lt;/td&gt;"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+					<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'>=</font> <font color='#AA0000'>(</font><font color='#0000AA'>mod</font> $idx <font color='#AA0000'>(</font><font color='#0000AA'>length</font> table_colspan<font color='#AA0000'>)</font><font color='#AA0000'>)</font> rowlength<font color='#AA0000'>)</font> <font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"&lt;/tr&gt;"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+				<font color='#AA0000'>)</font>
+			<font color='#AA0000'>)</font>	
+			<font color='#008800'>"&lt;/tbody&gt;"</font>
+  	<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:table_footer &lt;table_footer_text&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;table_footer_text&gt; a string containing the table footer text</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard table footer with number of colspan generated from the last table-head.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>table_footer table_footer_text<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> "
+	&lt;tfoot&gt;&lt;tr&gt;&lt;td class='table_foot' colspan='<font color='#008800'>"(length table_colspan)"</font>'><font color='#008800'>"table_footer_text"</font>&lt;/td&gt;&lt;/tr&gt;&lt;/tfoot&gt;"
+  <font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:table_close)</font>
+<font color='#555555'>;; &lt;p&gt;Writes a standard table close element.&lt;/p&gt;</font>
+<font color='#555555'>;; </font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>table_close<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>print</font> <font color='#008800'>"&lt;/table&gt;&lt;!-- END table -->"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !nldb Wrapper for a pure newLISP Database (flat)</font>
+<font color='#555555'>;===============================================================================</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>create-sampledatabase, databasename<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font> <font color='#0000AA'>if</font> <font color='#AA0000'>(</font> <font color='#0000AA'>not</font> <font color='#AA0000'>(</font> <font color='#0000AA'>find</font> databasename <font color='#AA0000'>(</font> <font color='#0000AA'>directory</font> <font color='#AA0000'>)</font><font color='#AA0000'>)</font> <font color='#AA0000'>)</font> 
+	   <font color='#AA0000'>(</font> <font color='#0000AA'>begin</font>
+		 <font color='#AA0000'>(</font> nldb:create-table 'demo '<font color='#AA0000'>(</font> amount what where who datevalue <font color='#0000AA'>when</font> <font color='#AA0000'>)</font> <font color='#AA0000'>)</font> 
+	     <font color='#AA0000'>(</font> <font color='#0000AA'>set</font> 'financier_entry <font color='#AA0000'>(</font><font color='#0000AA'>list</font>  <font color='#008800'>"$10 "</font> <font color='#008800'>"Google AdWords"</font> <font color='#008800'>"Advertising"</font> <font color='#008800'>"Marc"</font> <font color='#AA0000'>(</font><font color='#0000AA'>date-value</font><font color='#AA0000'>)</font><font color='#AA0000'>(</font><font color='#0000AA'>date</font> <font color='#AA0000'>)</font> <font color='#AA0000'>)</font> <font color='#AA0000'>)</font>
+			<font color='#AA0000'>(</font><font color='#0000AA'>dotimes</font> <font color='#AA0000'>(</font>i <font color='#665500'>30</font><font color='#AA0000'>)</font>
+	     		<font color='#AA0000'>(</font> nldb:add-row 'demo  financier_entry <font color='#AA0000'>)</font>
+			<font color='#AA0000'>)</font>
+	     <font color='#AA0000'>(</font> nldb:save-db databasename <font color='#AA0000'>)</font>
+
+	   <font color='#AA0000'>)</font>
+	   <font color='#AA0000'>(</font>nldb:load-db databasename<font color='#AA0000'>)</font> <font color='#555555'>; else load existing database</font>
+	<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>create-database, databasename<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'>not</font> <font color='#AA0000'>(</font><font color='#0000AA'>find</font> databasename <font color='#AA0000'>(</font> <font color='#0000AA'>directory</font> <font color='#AA0000'>)</font><font color='#AA0000'>)</font> <font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>begin</font>
+			<font color='#AA0000'>(</font>nldb:save-db databasename<font color='#AA0000'>)</font> <font color='#555555'>; creating database</font>
+		<font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font>nldb:load-db databasename<font color='#AA0000'>)</font> <font color='#555555'>; else load existing database</font>
+	<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>create-table, databasename tablename fields<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font>nldb:load-db databasename<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font>nldb:create-table 'tablename fields <font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font>nldb:save-db databasename<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:show-database)</font>
+<font color='#555555'>;; &lt;p&gt;Writes some information about the currently used nldb&lt;/p&gt;</font>
+<font color='#555555'>;;</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>show-database<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>println</font> "
+	&lt;div id='dragonfly_database-information' style='border:1px dotted #00aeef<font color='#555555'>; width:700px; padding:8px; margin-top:20px;' ></font>
+	&lt;h2&gt;Database information&lt;/h2&gt;&lt;pre&gt;
+	"<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font>nldb:show<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"&lt;/pre&gt;&lt;/div&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !sqlite3 Wrapper</font>
+<font color='#555555'>;===============================================================================</font>
+
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:sqlite-open &lt;databasename&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;databasename&gt; string containing the database name</font>
+<font color='#555555'>;; &lt;p&gt;Open the SQLite database or creates it, if it does not exist.&lt;/p&gt;</font>
+<font color='#555555'>;;</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>sqlite-open databasename<font color='#AA0000'>)</font>
+	<font color='#555555'>;; close old connections</font>
+	<font color='#AA0000'>(</font>sql3:close<font color='#AA0000'>)</font>
+	
+	<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font>sql3:open databasename<font color='#AA0000'>)</font> 
+		<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'flashnotice <font color='#008800'>"Database was successfully opened or created."</font><font color='#AA0000'>)</font> 
+	<font color='#AA0000'>)</font> 	
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:sqlite-tables)</font>
+<font color='#555555'>;; &lt;p&gt;Shows the existing tables in the current database.&lt;/p&gt;</font>
+<font color='#555555'>;;</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>sqlite-tables<font color='#AA0000'>)</font> 
+	<font color='#AA0000'>(</font><font color='#0000AA'>println</font> "
+	&lt;div id='dragonfly_database-information' style='border:1px dotted #00aeef<font color='#555555'>; width:800px; padding:8px; margin-top:20px;margin-bottom:20px' ></font>
+	&lt;h2&gt;Existing tables in SQLite Database&lt;/h2&gt;&lt;pre&gt;
+	"
+	<font color='#AA0000'>(</font>sql3:tables<font color='#AA0000'>)</font>"
+	&lt;/pre&gt;&lt;/div&gt;"<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:sqlite-columns)</font>
+<font color='#555555'>;; &lt;p&gt;Shows the existing columns in a given table.&lt;/p&gt;</font>
+<font color='#555555'>;;</font>
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>sqlite-columns table<font color='#AA0000'>)</font> 
+	<font color='#AA0000'>(</font><font color='#0000AA'>println</font> "
+	&lt;div id='dragonfly_database-information' style='border:1px dotted #00aeef<font color='#555555'>; width:800px; padding:8px; margin-top:20px;margin-bottom:20px' ></font>
+	&lt;h2&gt;Existing columns in SQLite table &lt;i&gt;<font color='#008800'>"table"</font>&lt;/i&gt;&lt;/h2&gt;&lt;pre&gt;
+	"
+	<font color='#AA0000'>(</font>sql3:columns table<font color='#AA0000'>)</font>"
+	&lt;/pre&gt;&lt;/div&gt;"<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>sqlite-empty-table table<font color='#AA0000'>)</font> 
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'query <font color='#AA0000'>(</font><font color='#0000AA'>append</font> <font color='#008800'>"DELETE FROM "</font>table<font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font>sql3:sql query<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>sqlite-query query<font color='#AA0000'>)</font> 
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'sqlarray <font color='#AA0000'>(</font>sql3:sql query<font color='#AA0000'>)</font><font color='#AA0000'>)</font> <font color='#555555'>; results of query</font>
+	<font color='#555555'>;; close old connections</font>
+	<font color='#AA0000'>(</font>sql3:close<font color='#AA0000'>)</font>	
+<font color='#AA0000'>)</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>sqlite-insert table values<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'query <font color='#AA0000'>(</font><font color='#0000AA'>append</font> <font color='#008800'>"INSERT INTO "</font>table<font color='#008800'>" VALUES ("</font>values<font color='#008800'>")"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font>sql3:sql query<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>sqlite-get-tabledata query<font color='#AA0000'>)</font> 
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'sqlarray <font color='#AA0000'>(</font>sql3:sql query<font color='#AA0000'>)</font><font color='#AA0000'>)</font> <font color='#555555'>; results of query</font>
+	
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !twitter functions</font>
+<font color='#555555'>;===============================================================================</font>
+
+<font color='#555555'>;; <font color='#308080'>@syntax</font> (Dragonfly:twitter-search &lt;keyword&gt;)</font>
+<font color='#555555'>;; <font color='#308080'>@param</font> &lt;keyword&gt; string containing the keyword for search</font>
+<font color='#555555'>;; &lt;p&gt;Writes the results of the search in nice speech bubbles.&lt;/p&gt;</font>
+<font color='#555555'>;;</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>twitter-search keyword rpp<font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'xml <font color='#AA0000'>(</font><font color='#0000AA'>get-url</font> <font color='#AA0000'>(</font><font color='#0000AA'>string</font> <font color='#008800'>"http://search.twitter.com/search.atom?rpp="</font>rpp<font color='#008800'>"&amp;q="</font>keyword<font color='#AA0000'>)</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>xml-type-tags</font> <font color='#0000AA'>nil</font> <font color='#0000AA'>nil</font> <font color='#0000AA'>nil</font> <font color='#0000AA'>nil</font><font color='#AA0000'>)</font> <font color='#555555'>; no extra tags</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'sxml <font color='#AA0000'>(</font><font color='#0000AA'>xml-parse</font> xml <font color='#665500'>31</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font> <font color='#555555'>; turn on SXML options</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'entry-index <font color='#AA0000'>(</font><font color='#0000AA'>ref-all</font> '<font color='#AA0000'>(</font>entry <font color='#0000AA'>*</font><font color='#AA0000'>)</font> sxml <font color='#0000AA'>match</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>when</font> <font color='#AA0000'>(</font><font color='#0000AA'>empty?</font> entry-index<font color='#AA0000'>)</font>
+    <font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"No entries found"</font><font color='#AA0000'>)</font>
+  <font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"&lt;div id='twitter_search_results'>&lt;h3&gt;You searched for '"</font>keyword<font color='#008800'>"' and we found&lt;/h3&gt;"</font><font color='#AA0000'>)</font>
+  <font color='#AA0000'>(</font><font color='#0000AA'>dolist</font> <font color='#AA0000'>(</font>idx entry-index<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"&lt;div class='bubble'>&lt;blockquote&gt;&lt;p&gt;"</font><font color='#AA0000'>)</font>    
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'entry <font color='#AA0000'>(</font>sxml idx<font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+    <font color='#AA0000'>(</font><font color='#0000AA'>println</font> 
+				<font color='#AA0000'>(</font><font color='#0000AA'>lookup</font> 'title entry<font color='#AA0000'>)</font> 
+				<font color='#008800'>"&lt;/p&gt;&lt;/blockquote&gt;"</font>
+				<font color='#008800'>"&lt;cite&gt;&lt;strong&gt;"</font>
+				<font color='#AA0000'>(</font><font color='#0000AA'>lookup</font> '<font color='#AA0000'>(</font>author <font color='#0000AA'>name</font><font color='#AA0000'>)</font> entry <font color='#AA0000'>)</font> <font color='#008800'>"&lt;/strong&gt; on "</font> 
+			 	<font color='#AA0000'>(</font><font color='#0000AA'>lookup</font> 'published entry<font color='#AA0000'>)</font> <font color='#008800'>"&lt;/cite&gt;&lt;/div&gt;"</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"&lt;/div&gt;"</font><font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !SEO functions (just ideas - really alpha!!!)</font>
+<font color='#555555'>;===============================================================================</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>clean-html<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'page <font color='#AA0000'>(</font><font color='#0000AA'>get-url</font> <font color='#008800'>"http://www.marchildmann.de/"</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>replace</font> <font color='#008800'>"<[^>]*>"</font> page <font color='#008800'>""</font> <font color='#665500'>0</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>println</font> page<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+   
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>check-meta-description<font color='#AA0000'>)</font>
+	
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'description "&lt;meta name=&#092;&#034;description&#092;&#034;`
+	      content=&#092;&#034;newLISP is a general purpose scripting language <font color='#0000AA'>for</font> developing web applications <font color='#0000AA'>and</font> programs in general <font color='#0000AA'>and</font> in the domains of artificial intelligence <font color='#AA0000'>(</font>AI<font color='#AA0000'>)</font> <font color='#0000AA'>and</font> statistics.&#092;&#034;>"<font color='#AA0000'>)</font>
+	<font color='#555555'>;;(println (regex "&lt;meta name=&#092;&#034;description&#092;&#034; content=&#092;&#034;(.*)&#092;&#034;>/i" "&lt;meta name=&#092;&#034;description&#092;&#034;`</font>
+	<font color='#555555'>;;	      content=&#092;&#034;newLISP is a general purpose scripting language for developing web applications and programs in general and in the domains of artificial intelligence (AI) and statistics.&#092;&#034;>"))</font>
+	<font color='#555555'>;;(println $0)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'description-length <font color='#AA0000'>(</font><font color='#0000AA'>length</font> description<font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>or</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'><</font> description-length <font color='#665500'>60</font><font color='#AA0000'>)</font> <font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"Your meta description with "</font>description-length<font color='#008800'>" characters is too short."</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'>></font> description-length <font color='#665500'>170</font><font color='#AA0000'>)</font> <font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"Your meta description with "</font>description-length<font color='#008800'>" characters is too long."</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>and</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'>>=</font> description-length <font color='#665500'>60</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'><=</font> description-length <font color='#665500'>170</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"Your meta description with "</font>description-length<font color='#008800'>" characters is ideal."</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>check-meta-keywords keywords<font color='#AA0000'>)</font>
+	
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'number-keywords <font color='#AA0000'>(</font><font color='#0000AA'>length</font> keywords<font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>or</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'><</font> number-keywords <font color='#665500'>5</font><font color='#AA0000'>)</font> <font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"The number of meta-keywords "</font>number-keywords<font color='#008800'>" are too small."</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'>></font> number-keywords <font color='#665500'>10</font><font color='#AA0000'>)</font> <font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"The number of meta-keywords "</font>number-keywords<font color='#008800'>" are too much."</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>and</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'>>=</font> number-keywords <font color='#665500'>5</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>if</font> <font color='#AA0000'>(</font><font color='#0000AA'><=</font> number-keywords <font color='#665500'>10</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>println</font> <font color='#008800'>"Your number of meta-keywords "</font>number-keywords<font color='#008800'>" are ideal."</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+<font color='#555555'>;===============================================================================</font>
+<font color='#555555'>; !Google functions</font>
+<font color='#555555'>;===============================================================================</font>
+
+<font color='#AA0000'>(</font><font color='#0000AA'>define</font> <font color='#AA0000'>(</font>google-results-domain domain<font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'json <font color='#AA0000'>(</font><font color='#0000AA'>get-url</font> <font color='#AA0000'>(</font><font color='#0000AA'>string</font> <font color='#008800'>"http://ajax.googleapis.com/ajax/services/search/web?v=1.0&amp;q="</font>domain<font color='#AA0000'>)</font><font color='#AA0000'>)</font><font color='#AA0000'>)</font>
+	<font color='#AA0000'>(</font><font color='#0000AA'>begin</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>regex</font> <font color='#008800'>"&#092;&#034;estimatedResultCount&#092;&#034;:&#092;&#034;(.*)&#092;&#034;,"</font> json<font color='#AA0000'>)</font>
+		<font color='#AA0000'>(</font><font color='#0000AA'>set</font> 'erc $1<font color='#AA0000'>)</font>	
+	<font color='#AA0000'>)</font>
+<font color='#AA0000'>)</font>
+
+
+<font color='#AA0000'>(</font><font color='#0000AA'>context</font> MAIN<font color='#AA0000'>)</font>
+
+</pre><center><font face='Arial' size='-3' color='#666666'>syntax highlighting with <a href="http://newlisp.org">newLISP</a>&nbsp;and <a href="http://newlisp.org/newLISPdoc.html">newLISPdoc</a></font></center></body></html>

dragonfly-framework/docs/index.html

+<!DOCTYPE HTML PUBLIC "HTML 4.01 Transitional">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Index</title>
+
+<link rel="stylesheet" type="text/css" href="newlispdoc.css" />
+</head>
+
+<body style="margin: 20px;" text="#111111" bgcolor="#FFFFFF" 
+			link="#376590" vlink="#551A8B" alink="#ffAA28">
+<blockquote>
+<center><h1>Index</h1></center>
+<a href="dragonfly.lsp.html"><br/><br/><h2>Module:&nbsp;Dragonfly</h2></a>
+<p>A newLISP web framework for rapid web development</p>
+<a href="dragonfly.lsp.html#Dragonfly_listener">listener</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_benchmark-start">benchmark-start</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_benchmark-end">benchmark-end</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_debugging">debugging</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_template">template</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_partial">partial</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_css">css</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_meta">meta</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_rss">rss</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_script">script</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_meta-iphone">meta-iphone</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_compare-lists">compare-lists</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_google-analytics">google-analytics</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_todays-date-german">todays-date-german</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_time-now">time-now</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_image">image</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_link_to">link_to</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_link_mailto">link_mailto</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_form_open">form_open</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_form_textfield">form_textfield</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_form_submit">form_submit</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_form_hidden">form_hidden</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_form_close">form_close</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_form_generate-from-columns">form_generate-from-columns</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_table_open">table_open</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_table_data">table_data</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_table_footer">table_footer</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_table_close">table_close</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_show-database">show-database</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_sqlite-open">sqlite-open</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_sqlite-tables">sqlite-tables</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_sqlite-columns">sqlite-columns</a>&nbsp; &nbsp; <a href="dragonfly.lsp.html#Dragonfly_twitter-search">twitter-search</a>&nbsp; &nbsp; 
+<br/><br/><center>- &part; -</center><br/>
+<center><font face='Arial' size='-2' color='#444444'>
+generated with <a href="http://newlisp.org">newLISP</a>&nbsp;
+and <a href="http://newlisp.org/newLISPdoc.html">newLISPdoc</a>
+</font></center>
+</blockquote>
+</body>
+</html>

dragonfly-framework/dragonfly.lsp

+;;  Copyright (C) <2009> <Marc Hildmann>
+;;
+;;  This program is free software: you can redistribute it and/or modify
+;;  it under the terms of the GNU General Public License as published by
+;;  the Free Software Foundation, either version 3 of the License, or
+;;  (at your option) any later version.
+;;
+;;  This program is distributed in the hope that it will be useful,
+;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;  GNU General Public License for more details.
+;;  You should have received a copy of the GNU General Public License
+;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;;
+;; @module Dragonfly
+;; @author Marc Hildmann <marc.hildmann at gmail.com>
+;; @version 0.20
+;; 
+;; @location http://code.google.com/p/dragonfly-newlisp/
+;; @description A newLISP web framework for rapid web development
+;; <h4>About Dragonfly web framework</h4>
+;; <p>Dragonfly is a small web framework which is currently under heavy development.
+;; Its's features are a short learning curve, lightweight and fun in programming - 
+;; just like newLISP itself.</p>
+
+;===============================================================================
+; !Loading modules and defining new context
+;===============================================================================
+
+(context 'Dragonfly)
+
+; setting some constants for Dragonfly
+(constant 'dragonfly_version "Version 0.20")
+(constant 'host (env "HTTP_HOST"))
+(constant 'documentroot (env "DOCUMENT_ROOT"))
+(constant 'dragonfly-root (append (env "DOCUMENT_ROOT")"/dragonfly-framework"))
+(constant 'useragent (env "HTTP_USER_AGENT"))
+(constant 'server (env "SERVER_SOFTWARE"))
+(constant 'programfiles (env "PROGRAMFILES"))
+(constant 'proxy (env "HTTP_PROXY"))
+
+; init HTTP Status Codes for Dragonfly listener
+
+(constant 'http-200 "Status: 200 OK\r\n")
+(constant 'http-301 "Status: 301 Moved Permanently\r\n")
+(constant 'http-400 "Status: 400 Bad Request\r\n")
+(constant 'http-401 "Status: 401 Unauthorized\r\n")
+(constant 'http-403 "Status: 403 Forbidden\r\n")
+(constant 'http-404 "Status: 404 Not Found\r\n")
+(constant 'http-410 "Status: 410 Gone\r\n")
+(constant 'http-500 "Status: 500 Internal Server Error\r\n")
+
+(constant 'http-html-header "Content-Type: text/html; charset=utf-8\r\nConnection: keep-alive\r\n")
+(constant 'http-xml-header "Content-Type: text/xml; charset=utf-8\r\nConnection: keep-alive\r\n")
+(constant 'http-atom-header "Content-Type: application/atom+xml; charset=utf-8\r\nConnection: keep-alive\r\n")
+
+
+; loading configuration files
+(set 'files (directory (append dragonfly-root"/config") "^[^.]")) ; show all files which do not start with a dot
+(dolist (filename files)
+	(load (append dragonfly-root"/config/"filename))
+)
+
+; loading additional (3rd party) modules in active directory
+(set 'files (directory (append dragonfly-root"/modules-active") "^[^.]")) ; show all files which do not start with a dot
+(dolist (filename files)
+	(load (append dragonfly-root"/modules-active/"filename))
+)
+
+; loading additional Dragonfly helper modules in active directory
+(set 'files (directory (append dragonfly-root"/helpers-active") "^[^.]")) ; show all files which do not start with a dot
+(dolist (filename files)
+	(load (append dragonfly-root"/helpers-active/"filename))
+)
+
+; set the paths to views and partials
+(constant 'views-path (append documentroot"/views/"))
+(constant 'partials-path (append documentroot"/views/partials/"))
+(constant 'databases-path (append documentroot"/databases/"))
+
+; init symbols for Dragonfly listener
+(set 'viewname "")
+(set 'action "")
+(set 'params "")
+(set 'selector "")
+
+;===============================================================================
+; !Core Functions
+;===============================================================================
+
+;; @syntax (Dragonfly:listener)
+;; <p>The Dragonfly listener parses the QUERY STRING
+;; for the specified view, action and params.</p>
+;;
+(define (listener)
+
+	(set 'query-list (clean empty? (parse (env "QUERY_STRING") "/|=" 0)))
+	
+	(cond		
+			
+			((ends-with query-list "xml")
+				(print http-xml-header)
+				;(print http-atom-header)
+				(print http-200)
+				(println)
+				(Dragonfly:view defaultrss))
+
+			((ends-with query-list "rss")
+				(print http-xml-header)
+				;(print http-atom-header)
+				(print http-200)
+				(println)
+				(Dragonfly:view defaultrss))
+			
+   			((empty? query-list)
+				(print http-html-header)
+				(print http-200)
+				(println)
+        		; no info at all, so just pass to default view
+       			(Dragonfly:view defaultview))
+
+   			((= (length query-list) 1)		
+
+				(print http-html-header)
+				(print http-200)
+				(println)
+        		; one argument means a selector.
+        		; pass the default view after setting selector
+       			(set 'selector (first query-list))				
+       			(Dragonfly:view defaultview))
+
+   			((> (length query-list) 1 )
+
+				(print http-html-header)
+				(print http-200)
+				(println)
+				
+      			; = 2 a view, followed by an action
+				; = 3 a view, followed by an action, followed by params
+				(map set '(viewname action params) query-list)
+       			; (println  { template: } viewname { action: } action { params: } params)
+       			; (params will be nil if length is 2)
+				
+       			(Dragonfly:view viewname))
+
+	)
+)
+
+
+(define (listener2)
+
+	; at first get the query
+	(set 'query-list (clean empty? (parse (env "QUERY_STRING") "/|=" 0)))
+	; then map the query to view, action and params
+	(map set '(viewname action params) query-list)
+	
+	; check for all existing views ...
+	(set 'files (directory views-path "^[^.]")) ; show all files which do not start with a dot
+	; if the current view doesn't exist, then throw a 404
+
+	(print http-html-header)
+	(print http-200)
+	(println)
+	
+	(println files)
+	(exit)
+	
+	(if (nil? (find viewname files))
+		(begin
+			(print "Status: 404\r\n")
+			(println)
+			(print http-html-header)
+			(Dragonfly:view "404")
+		)
+		; else check some conditions ...
+		(cond
+
+				((ends-with query-list "xml")
+					(print http-xml-header)
+					;(print http-atom-header)
+					(print http-200)
+					(println)
+
+					(Dragonfly:view defaultrss))
+
+				((ends-with query-list "rss")
+					(print http-xml-header)
+					;(print http-atom-header)
+					(print http-200)
+					(println)
+
+					(Dragonfly:view defaultrss))
+
+		   		((empty? query-list)
+
+					(print http-html-header)
+					(print http-200)
+					(println)
+		        	; no info at all, so just pass to default view
+		       		(Dragonfly:view defaultview))
+
+		   		((= (length query-list) 1)		
+
+					(print http-html-header)
+					(print http-200)
+					(println)
+		        	; one argument means a selector.
+		        	; pass the default view after setting selector
+		       		(set 'selector (first query-list))				
+		       		(Dragonfly:view defaultview))
+
+		   		((> (length query-list) 1 )
+
+					(print http-html-header)
+					(print http-200)
+					(println)
+					(Dragonfly:view viewname))
+
+
+		) ; end of conditions
+		
+	)
+	
+)
+
+;; @syntax (Dragonfly:benchmark-start)
+;; <p>Sets the start point for benchmarking.</p>
+;; 
+(define (benchmark-start)
+	(set 'microtime-start (time-of-day))
+)
+
+;; @syntax (Dragonfly:benchmark-end)
+;; <p>Sets the end point for benchmarking and calculates the result in milliseconds plus
+;; some information about memory usage.</p>
+;; 
+(define (benchmark-result)
+
+  	(set 'mem_cells_bytes (* (sys-info 0) 16))
+  	(set 'mem_cells_kilobytes (/ mem_cells_bytes 1024))
+
+  	(set 'mem_cells-constant_bytes (* (sys-info 1) 16))
+  	(set 'mem_cells-constant_kilobytes (/ mem_cells-constant_bytes 1024))
+  	(set 'mem_cells-constant_megabytes (/ mem_cells-constant_kilobytes 1024))
+
+  	(set 'mem_symbols_bytes (* (sys-info 2) 32))
+  	(set 'mem_symbols_kilobytes (/ mem_symbols_bytes 1024))
+
+    (set 'mem_total_usage (+ mem_cells_kilobytes mem_symbols_kilobytes))
+  
+	(set 'microtime-end (time-of-day))
+	(set 'execution-time-milliseconds (- microtime-end microtime-start))
+	(set 'execution-time-seconds (div execution-time-milliseconds 1000))
+	(println "<div id='dragonfly_benchmark'>Rendered in "execution-time-milliseconds" milliseconds. Used "mem_total_usage" KB of memory.<br/><div id='dragonfly_logo'><a href='http://code.google.com/p/dragonfly-newlisp/'>&mdash;()o Dragonfly <span class='dragonfly_uppercase'>web framework "dragonfly_version"</span></a></div></div>")
+	
+)
+
+;; @syntax (Dragonfly:debugging)
+;; <p>Writes some debug information to the screen. Requires Web.lsp module for POST and GET information.</p>
+;; 
+(define (debugging)
+
+  (set 'mem_cells_bytes (* (sys-info 0) 16))
+  (set 'mem_cells_kilobytes (/ mem_cells_bytes 1024))
+
+  (set 'mem_cells-constant_bytes (* (sys-info 1) 16))
+  (set 'mem_cells-constant_kilobytes (/ mem_cells-constant_bytes 1024))
+  (set 'mem_cells-constant_megabytes (/ mem_cells-constant_kilobytes 1024))
+
+  (set 'mem_symbols_bytes (* (sys-info 2) 32))
+  (set 'mem_symbols_kilobytes (/ mem_symbols_bytes 1024))
+
+  (set 'mem_total_usage (+ mem_cells_kilobytes mem_symbols_kilobytes))
+
+  (println "
+	<div id='dragonfly_debug' style='width:474px; margin-top:20px;' >
+	<h1>Dragonfly DEBUG information</h1><br/>
+	<h2>HOST</h2>"host"
+	<h2>DOCUMENT ROOT</h2>"documentroot"
+	<h3>DRAGONFLY ROOT</h3>"dragonfly-root"
+	<h3>Windows Programfiles</h3>"programfiles"
+	<h3>QUERY</h3>"(env "QUERY_STRING")"
+	<h3>DEFAULT VIEW</h3>"defaultview"
+	<h3>DEFAULT ACTION</h3>"defaultaction"
+	<h3>CURRENT VIEW</h3>"viewname"
+	<h3>CURRENT ACTION</h3>"action"
+	<h3>CURRENT SELECTOR</h3>"selector"
+	<h3>CURRENT PARAMS</h3>"params"
+	<h3>USER-AGENT</h3>"useragent"
+	<h3>Proxy</h3>"proxy"
+	<h3>SERVER</h3>"server"
+	<h3>POST</h3>"Web:POST"
+	<h3>GET</h3>"Web:GET"
+	<h3>System information</h3>
+	<ul>
+		<li>Total memory usage: "mem_total_usage" KB</li>	
+		<li>Number of Lisp Cells (16 bytes per cell): "(sys-info 0)"</li>
+		<li>Memory used by Lisp Cells: "mem_cells_kilobytes" KB</li>
+		<li>Maximum number of Lisp cells constant: "(sys-info 1)"</li>
+		<li>Maximum memory used by Lisp cells constant: "mem_cells-constant_megabytes" MB</li>
+		<li>Number of symbols (32 bytes per symbol): "(sys-info 2)"</li>
+		<li>Memory used by symbols: "mem_symbols_kilobytes" KB</li>
+		<li>Evaluation/recursion level: "(sys-info 3)"</li>
+		<li>Environment stack level: "(sys-info 4)"</li>
+		<li>Maximum call stack constant: "(sys-info 5)"</li>
+		<li>Pid of running newLISP process: "(sys-info 6)"</li>
+		<li>Version number as an integer constant: "(sys-info 7)"</li>
+		<li>Operating system constant: "(sys-info 8)"</li>
+		<li>Used symbols in Dragonfly: <pre>"(symbols 'Dragonfly)"</pre></li>
+		<li>Last system error: "(sys-error)"</li>
+	</ul>
+	
+	</div>")
+)
+
+
+;; @syntax (Dragonfly:view <view>)
+;; @param <viewname> name of view
+;; <p>Evaluates the view and returns it.</p>
+;; 
+(define (view viewname)
+	(set 'path-to-views views-path)
+    (push viewname path-to-views -1)
+	(if (nil? (read-file path-to-views))
+		(begin
+			(set 'path-to-error-views views-path)
+			(push default404 path-to-error-views -1)
+			(Web:eval-template (read-file path-to-error-views))	
+		)
+			(Web:eval-template (read-file path-to-views))				
+	)
+)
+
+;; @syntax (Dragonfly:partial <partial>)
+;; @param <partial> name of partial
+;; <p>Evaluates the partial and returns it.</p>
+;; 
+(define (partial partialname)
+  	(Web:eval-template (read-file (append partials-path partialname)))
+)
+
+;; @syntax (Dragonfly:title <websitename>)
+;; @param <websitename> a string containing creen or print
+;; <p>Writes a title including the current navigation entry.</p>
+;; 
+(define (title websitename)
+  (print (append (title-case (replace "_" viewname " ")) " " websitename  ))
+)
+
+;; @syntax (Dragonfly:css <css-media> <css-location>)
+;; @param <css-media> a string containing screen or print
+;; @param <css-location> the location of your stylesheet
+;; <p>Writes a standard stylesheet HTML tag.</p>
+;; 
+(define (css css-media css-location)
+  (print "<link rel='stylesheet' type='text/css' media='"css-media"' href='"css-location"' />")
+)
+
+;; @syntax (Dragonfly:meta <meta-name> <meta-content>)
+;; @param <meta-name> a string containing the meta-name
+;; @param <meta-content> a string containing the meta content
+;; <p>Writes a standard meta HTML tag.</p>
+;; 
+(define (meta meta-name meta-content)
+  (print "<meta name='"meta-name"' content='"meta-content"' />")
+)
+
+;; @syntax (Dragonfly:rss <rss-title> <rss-location>)
+;; @param <rss-title> a string containing the rss title
+;; @param <rss-location> a string containing the rss location
+;; <p>Writes a standard RSS HTML tag.</p>
+;; 
+(define (rss rss-title rss-location)
+  (print "<link rel='alternate' type='application/rss+xml' title='"rss-title"' href='"rss-location"' />")
+)
+
+;; @syntax (Dragonfly:script <script-location>)
+;; @param <script-location> a string containing the script location
+;; <p>Writes a standard script HTML tag.</p>
+;; 
+(define (script script-location)
+  (print "<script type='text/javascript' src='"script-location"'></script>")
+)
+
+;; @syntax (Dragonfly:autoload-css css-media css-screen css-iphone)
+;; @param <css-media> a string containing the css media type
+;; @param <css-screen> a string containing the path to screen stylesheet
+;; @param <css-iphone> a string containing the path to iPhone stylesheet
+;; <p>Detects the iPhone and loads the apropiate CSS.</p>
+;; 
+(define (autoload-css css-media css-screen css-iphone)
+  (if (find "iPhone" useragent)
+	(print "<!-- found iPhone --><meta name='viewport' content='width=320, user-scalable=yes' /><link rel='stylesheet' type='text/css' media='"css-media"' href='"css-iphone"' />")
+	(print "<!-- no iPhone detected ... loading screen stylesheets --><link rel='stylesheet' type='text/css' media='"css-media"' href='"css-screen"' />")
+  )
+)
+
+
+;; @syntax (Dragonfly:compare-lists <list1> <list2>)
+;; @param <list1> list number 1
+;; @param <list2> list number 2
+;; <p>Compares two lists and return the score of same and same position. This is a function by cormullion.</p>
+;;
+(define (compare-lists list1 list2)
+	(print "Comparing " list1 " and " list2 " ...")
+	(print " "(first (count '(true) (map = list1 list2))) " elements are the same and in the same position.")
+)
+
+;; @syntax (Dragonfly:google-analytics <analytics-id>)
+;; @param <analytics-id> enter the specified id provided by Google Analytics, e.g. UA-123456-7
+;; <p>Writes the Google Analytics tracking code.</p>
+;;
+(define (google-analytics analytics-id)
+	(print "
+	<script type=\"text/javascript\">
+		var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");
+		document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));
+		</script>
+		<script type=\"text/javascript\">
+		try {
+			var pageTracker = _gat._getTracker(\""analytics-id"\");
+			pageTracker._trackPageview();
+		} catch(err) {}
+	</script>				
+	")
+)
+
+
+
+;===============================================================================
+; !Date Functions
+;===============================================================================
+
+;; @syntax (Dragonfly:todays-date-german including actual time)
+;; <p>Writes todays date including time in german localization</p>
+;; 
+(define (todays-date-german)
+	(set-locale "de_DE")
+	(print (date (date-value) 0 "%A, den %d. %B %Y um %H:%M:%S Uhr"))
+)
+
+;; @syntax (Dragonfly:time-now)
+;; <p>Writes the actual time</p>
+;; 
+(define (time-now)
+	(print (date (date-value) 0 "%H:%M:%S"))
+)
+
+
+;===============================================================================
+; !Image Functions
+;===============================================================================
+
+;; @syntax (Dragonfly:image <image_name> <image_url>, <options>)
+;; @param <image_name> a string containing the image alternative title
+;; @param <image_url> a string containing the url
+;; @param <options> optional settings like class, rel, width, height ...
+;; <p>Writes a standard HTML image.</p>
+;; 
+(define (image image-name image-url, image-options)
+  (print "<img src='"image-url"' alt='"image-name"' title='"image-name"' border='0' "image-options" />")
+)
+
+
+;===============================================================================
+; !Link Functions
+;===============================================================================
+
+;; @syntax (Dragonfly:link_to <link_name> <view>)
+;; @param <link_name> a string containing the link's name
+;; @param <view> a string containing the view
+;; <p>Writes a internal link</p>
+;; 
+(define (link_to link-name view action)
+	
+  	; if Dragonfly runs on newLISP webserver, we cannot
+  	; use .htaccess, so we've to write the "?" into the url
+    ; else we miss it
+	(if (true? (find "newLISP" server))
+		(set 'link-url (append "?" view "/" action))
+		(set 'link-url (append "/" view "/" action))
+	)
+	
+  	(print "<a href='"link-url"'>"link-name"</a>")
+)
+
+;; @syntax (Dragonfly:link_to <link_name> <url>)
+;; @param <link_name> a string containing the link's name
+;; @param <url> a string containing the target URL
+;; <p>Writes a standard HTML link</p>
+;; 
+(define (link_to_external link-name url)
+		
+  	(print "<a href='"url"'>"link-name"</a>")
+
+)
+
+;; @syntax (Dragonfly:link_mailto <link_name> <options>)
+;; @param <name> a string containing the link's name
+;; @param <options> a string containing the url
+;; <p>Writes a standard HTML mailto link</p>
+;; 
+(define (link_mailto link-name link-url)
+  (print "<a href='mailto:"link-url"'>"link-name"</a>")
+)
+
+
+;===============================================================================
+; !AJAX Functions
+;===============================================================================
+
+;; @syntax (Dragonfly:ajax-updater <html-elementid> <request-url> <params-url> <timeout>)
+;; @param <html-elementid> a string containing the elementID
+;; @param <request-url> a string containing the url which is called frequently
+;; @param <params-url> a string containing params which are POSTED against request-url
+;; @param <timeout> an integer containing the number of microseconds after recalling the request-url
+;; <p>Writes a simple AJAX-updater, e.g. for displaying the time on a website.</p>
+;;
+(define (ajax-updater html-elementid request-url params-url timeout)
+	(print "<div id='"html-elementid"'>&nbsp;</div>")
+	(print "<script language='javascript'>")