Commits

Greg Slepak committed 26b8b89

- modified header.html partial to remove the head tags so that extra elements can be added to the head on a per-page basis.
- added a new dragonfly_api view, along with a dragonfly_api plugin
- updated some documentation (still not finished)
- added a link to the core reference api with some jQuery magic + showing off the 'include' function

Comments (0)

Files changed (24)

 
 	newlisp -d 8080 -w . -http
 
-Open Your browser and type localhost:8080 - have FUN!
+Open Your browser and visit http://localhost:8080/ - have FUN!
 
-For installation information see INSTALL.
+For installation information see INSTALL or after running
+the above command visit:
+
+	http://localhost:8080/?dragonfly_welcome
+

example-site/dragonfly-framework/plugins-active/dragonfly_basic.lsp

 	)
 )
 
-
 ;===============================================================================
 ; !RSS Functions
 ;===============================================================================

example-site/dragonfly-framework/plugins-inactive/dragonfly_api.lsp

+;;  Copyright (C) <2009> <Marc Hildmann, Greg Slepak>
+;;
+;;  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>, Greg Slepak <greg at taoeffect.com>
+;; @version 0.50
+;; 
+;; @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>
+
+(context 'Dragonfly)
+
+(define (api-browser (path "../api-docs/index.html"))
+	(print (format [text]
+		<div id="api-browser">&nbsp</div>
+		<script type="text/javascript">
+			(function api_browse(path, anchor) {
+				$.post("/?dragonfly_ajax-api", "path=" + path,
+					function (data) {
+						$("#api-browser").html(data);
+						$("#api-browser a").click(function () {
+							var url = this.href.split('/').pop();
+							var parts = url.split('#');
+							api_browse('../api-docs/'+parts[0],
+								parts.length == 2 ? parts[1] : null);
+							return false;
+						});
+						if (anchor)
+							$.scrollTo("#api-browser a[name='"+anchor+"']", 400);
+					}
+				);
+			})("%s");
+		</script>
+		[/text] path)
+	)
+)
+
+(context Dragonfly)

example-site/foo/index.html

 <% (setf viewname "Foo Static Page") %>
 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 

example-site/includes/css/screen.css

 		width:60px;
 	}
 
-	#content p a { color: #00aeef; text-decoration: none; }
-	#content p a:hover {  text-decoration: underline; }
+	#content p.continue {
+		float: right;
+		font-family: Arial, "MS Trebuchet", sans-serif;
+	}
+
+	#content p a { color: #00aeef; text-decoration: none; border-bottom: 1px dotted #00aeef; }
 		
 	#content .author {
 		color:#00aeef;
 
 	/* Code Styling */
 
-	#content pre.code {
+	span.code {
+		font-family:Courier, mono;
+		font-size:12px;
+	}
+
+	#content pre.code, #api-browser pre {
 		width:auto;
 		margin-top:10px;
 		padding:10px;
 		background:#333333;
-		font-family:Courier;
+		font-family:Courier, mono;
 		font-size:10px;
 		color:#ffffff;
 	}
 		font-size:12px;
 		color:#000000;
 	}
-	
-	#content p.info b {
+
+	/* removed to allow use of b tag without upper-casing */
+	/*#content p.info b {
 		text-transform:uppercase;
 	}
+	#content p.config b {
+		text-transform:uppercase;
+	}*/
 
 	#content p.config {
 		margin-top:10px;
 		color:#000000;
 	}
 	
-	#content p.config b {
-		text-transform:uppercase;
-	}
-	
 	#content h3.code {
 		color:#00aeef;
 	}

example-site/includes/js/jquery.scrollTo-min.js

+/**
+ * jQuery.ScrollTo - Easy element scrolling using jQuery.
+ * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
+ * Dual licensed under MIT and GPL.
+ * Date: 5/25/2009
+ * @author Ariel Flesler
+ * @version 1.4.2
+ *
+ * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
+ */
+;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);

example-site/newlispServer

+#!/bin/bash
+
+echo "If all goes well visit http://localhost:8080 in your browser"
+newlisp -http -d 8080 -w .

example-site/views/about.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 

example-site/views/blog.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 

example-site/views/code.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 

example-site/views/dragonfly_ajax-api.html

+<% 
+(let (path ($POST "path"))
+	; security check! make sure they ain't asking
+	; for something they shouldn't be asking for!
+	(if (and (find "../api-docs/" path) (ends-with path ".html"))
+		(include path)
+		(die "bad path: " path)
+	)
+)
+%>

example-site/views/dragonfly_ajax.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 

example-site/views/dragonfly_api.html

+<%
+(set 'viewname "Dragonfly API")
+(activate-plugin "dragonfly_api")
+(display-partial "doctype")
+%>
+<head>
+	<%
+	(display-partial "header")
+	(script (web-root "includes/js/jquery.scrollTo-min.js"))
+	%>
+</head>
+<body>
+
+<div id="wrap">
+	<div id="header">
+		<% (display-partial "navigation") %>	
+		<div class="clear"></div>
+	</div>
+
+	<div id="content">
+				
+		<div class="title nomargin">
+			<p><% (title "| Dragonfly web framework") %><p>
+		</div>
+		
+		<% (api-browser) %>
+		
+		<div class="line-dotted"></div>
+
+		<% (benchmark-result) %>
+		
+		<div class="line-dotted"></div>
+		
+		
+	</div><!-- END CONTENT -->
+	
+</div><!-- END WRAP -->
+<% (display-partial "footer") %>
+

example-site/views/dragonfly_debug.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 

example-site/views/dragonfly_routes.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 
 			Dragonfly's routes are written in pure newLISP code and have no arbitrary constraints placed on them. They can be as simple or complex as you need them to be. In fact, Dragonfly's routes are so flexible that the defaults will often be all you'll need.
 		</p>
 		<h2>Static Routes</h2>
-		<p>Static Routes in Dragonfly provide two behaviours:</p>
+		<p>
+			<span class="code">Route.Static</span> is one of the two default routes that Dragonfly comes with. It offers a flexible method of serving template files to allow for a PHP-like development pattern (except PHP is replaced with newLISP code).
+		</p>
 		<ul>
 			<li>1a) example-site.com/somefile.html</li>
 			<li>1b) example-site.com/foo/</li>
 		</ul>
+		<p>
+			This route is very flexible, and there are only three configuration parameters that may want to adjust in <b>config.lsp</b>:
+		</p>
+		<h3 class="code">ENABLE_STATIC_TEMPLATES</h3>
+		<p>Default value: <b>true</b></p>
+		<p>
+			Setting this value to <b>nil</b> will remove <span class="code">Route.Static</span> from Dragonfly's list of routes. If you disable this and you're using Dragonfly with the Apache web server, be sure to also comment out this line in <b>.htaccess</b>:
+		<pre class="code">RewriteCond %{REQUEST_FILENAME} \.html$</pre>
+		<h3 class="code">STATIC_TRIGGER_EXTENSIONS</h3>
+		<p>Default value: <b>(".html")</b></p>
+		<p>
+			TODO: this
+		</p>
+		<h3 class="code">STATIC_TRANSFORMATIONS</h3>
+		<p>Default value:
+		<pre class="code">(
+    (string DOCUMENT_ROOT "/" _ "/index.html")
+    (begin (set 'viewname _)
+           (string VIEWS_PATH "/" _))
+    (begin (set 'viewname _)
+           (string VIEWS_PATH "/" _ VIEW_EXTENSION))
+)</pre></p>
+		<p>
+			TODO: this
+		</p>
 		
 		<h3 class="code">1a. example-site.com/somefile.html</h3>
-		<p>If somefile.html is an actual file, but the default configuration is set to filter that through the Route.Static that reads in the file and passes it through the template evaluator and then displays it.
+		<p>By default, Dragonfly is setup to process html for <% (link_to "any newLISP code" "dragonfly_views") %> they may contain. This is very similar to how PHP development works.
 		</p>
-		<p class="config"><b>Configuration</b><br/>You may change the constant STATIC_EXTENSION in config.lsp to whatever You want. Default is set to ".html".</p>
+		<p>
+			
+		</p>
+		<p class="config"><b>CONFIGURATION</b><br/>You may change the constant STATIC_EXTENSION in config.lsp to whatever You want. Default is set to ".html".</p>
 
 		<h3 class="code">1b. example-site.com/foo/</h3>
 		<p>If "foo" is a folder, then it will be searched for an index file by default. In the config.lsp, the STATIC_TEST_EXTENSIONS is set to ".html". So it will search for an "index.html" inside of the foo folder. If it exists it will pass it through the template evaluator and displays it.
 		</p>
-		<p class="config"><b>Configuration</b><br/>You may change the constant STATIC_TEST_EXTENSIONS in config.lsp to whatever You want. Default is set to ".html".</p>
+		<p class="config"><b>CONFIGURATION</b><br/>You may change the constant STATIC_TEST_EXTENSIONS in config.lsp to whatever You want. Default is set to ".html".</p>
 		
 		
 		<h2>RESTful Routes</h2>
 )
 
 (context MAIN)</pre>
-		<p class="config"><b>Configuration</b><br/>You may enable or disable RESTful handling by setting the constant ENABLE_RESTFUL_HANDLER in config.lsp. Default is set to "true".</p>
+		<p class="config"><b>CONFIGURATION</b><br/>You may enable or disable RESTful handling by setting the constant ENABLE_RESTFUL_HANDLER in config.lsp. Default is set to "true".</p>
 
-		<p class="config"><b>Configuration</b><br/>Set Your resource directory to whatever You want by changing the constant RESOURCES_PATH in config.lsp. Default is set to "/resources".</p>	
-		
+		<p class="config"><b>CONFIGURATION</b><br/>Set Your resource directory to whatever You want by changing the constant RESOURCES_PATH in config.lsp. Default is set to "/resources".</p>	
+		<p class="continue"><% (link_to "CONTINUE &raquo;" "dragonfly_views") %></p>
+		<div class="clear"></div>
 		<div class="line-dotted"></div>
 
 		<% (benchmark-result) %>

example-site/views/dragonfly_seo.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 

example-site/views/dragonfly_tables.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 

example-site/views/dragonfly_twitter.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 

example-site/views/dragonfly_views.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 
 		<p>Example: open Your favorite text-editor and enter the following:</p>
 		<pre class="code">Hello World</pre>
 		<p>Save the file as "hello" into Your views directory. Now open Your browser and navigate to <a href="http://www.example-site.com/hello">example-site.com/hello</a>. That's it!</p>
-		<p class="info"><b>Information</b><br/>You can put nearly everything into views: (X)HTML, Javascript, newLISP code.</p>
-		<p class="config"><b>Configuration</b><br/>If VIEW_EXTENSION is ".html" for example, then when example-site.com/hello is called Dragonfly will search for a "hello.html" file in the VIEWS_PATH. It also applies to the partials, too.</p>
+		<p class="info"><b>INFORMATION</b><br/>You can put nearly everything into views: (X)HTML, Javascript, newLISP code.</p>
+		<p class="config"><b>CONFIGURATION</b><br/>If VIEW_EXTENSION is ".html" for example, then when example-site.com/hello is called Dragonfly will search for a "hello.html" file in the VIEWS_PATH. It also applies to the partials, too.</p>
 
 		<h2>How to call functions inside a view</h2>
 		<pre class="code">&lt;% (benchmark-result) %&gt;</pre>
 		
 		<p>Put Your function call inside our open and close brackets and there You go! That will display some stats about rendering time and memory consumption.</p>
 		
-		<p class="info"><b>Information</b><br/>You can use all functions from newLISP and Dragonfly. Additionally You may write Your own functions inside a plugin and just put the file into the "plugins-active" directory.</p>
+		<p class="info"><b>INFORMATION</b><br/>You can use all functions from newLISP and Dragonfly. Additionally You may write Your own functions inside a plugin and just put the file into the "plugins-active" directory.</p>
 				
 		<h2>How to load a partial view</h2>
 		<p>Partials are just like views, there's really no difference. Sometimes it's nice

example-site/views/dragonfly_welcome.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 
 		</ul>
 		
 		<p>If you meet those requirements, great!
-		<p class="config"><b>Configuration</b><br/>If you're using a custom web server, you might want to setup your own redirection script based on the .htaccess file.
+		<p class="config"><b>CONFIGURATION</b><br/>If you're using a custom web server, you might want to setup your own redirection script based on the .htaccess file.
 		</p>
-
-		<h2>Step 1 - Copying Files</h2>
+		
+		<h2>newLISP Server</h2>
+		<p>You can easily run this website locally using newLISP's built-in web server:</p>
+		<pre class="code">$ cd path/to/dragonfly-newlisp/example-site
+$ newlisp -http -w . -d 8080</pre>
+		<p>Then just point your browser to:</p>
+		<p><span class="code">http://localhost:8080</span></p>
+		<p>When using newLISP as the server links must have a question mark prepended to them. For example:</p>
+		<p><span class="code">http://localhost:8080/?welcome</p>
+		<p class="info"><b>INFORMATION</b><br/>For information on how to configure dragonfly, see <a href="#config">Step 2: Configuring Dragonfly</a> below.</p>
+		
+		<h2>Apache Server</h2>
+		<h3 class="code">Step 1: Copying Files</h3>
 		<p>There are three things you'll need to copy into your site's root to install
-		Dragonfly. You'll find these files inside the 'example-site' folder.</p>
+		Dragonfly. You'll find these files inside the <span class="code">example-site</span> folder.</p>
 		
 		<ol>
-			<li>The 'dragonfly-framework' folder</li>
+			<li>The <span class="code">dragonfly-framework</span> folder</li>
 			<li>index.cgi</li>
 			<li>.htaccess (this file is hidden)</li>
 		</ol>
 		
 		<p>By "site root" we mean the folder that represents your basic web address,
-		for example if your website is located at:<br/><br/>
-		http://www.example-site.com/
-		<br/><br/>
-		And on your webserver that is represented by this folder (called the "site root"):
-		<br/><br/>
-		/home/www/example-site.com/
-		<br/><br/>
+		for example if your website is located at:</p><p>
+		<span class="code">http://www.example-site.com/</span>
+		</p><p>
+		If on your webserver that is represented by this folder (called the "site root"):
+		</p><p>
+		<span class="code">/home/www/example-site.com/</span>
+		</p><p>
 		Then that's the folder you'll want to copy the files into.
-		<br/><br/>
 		</p>
-		<p class="info"><b>Information</b><br/>If you'd like Dragonfly to live somewhere else inside your site root,
+		<p class="info"><b>INFORMATION</b><br/>If you'd like Dragonfly to live somewhere else inside your site root,
 		click <% (link_to "here" "setup_example") %> for instructions.</p>
 		
-		<h2>Step 2 - Configure Dragonfly</h2>
-		<p>Edit the 'config.lsp' file in dragonfly-framework.<br/><br/>Read through the comments (they begin with a semi-colon) for instructions on what the settings are for.<br/><br/>If you want to prevent .html files from being processed through Dragonfly, open the .htaccess file in the site root and read the comments there for how to disable that behavior.
+		<h3 class="code">Step 2: Configure Dragonfly</h3>
+		<p>You can configure various aspects of Dragonfly's behavior by editing the <b>config.lsp</b> file in the <span class="code">dragonfly-framework</span> folder.</p><p>Read through the comments (they begin with a semi-colon) for instructions on what the settings are for.</p>
+		<a name="config"></a>
+		<p>By default, Apache will send all .html files through Dragonfly for further processing (if necessary) to allow for PHP-like development. If you wish to change this behavior, open the .htaccess file in the site root and read through the comments there.
 		</p>
 
-		<h2>Step 3 - That's it!</h2>
+		<h3 class="code">Step 3: That's it!</h3>
 		<p>You're ready to run Dragonfly!</p>
-		
+		<p class="continue"><% (link_to "CONTINUE &raquo;" "dragonfly_routes") %></p>
+		<div class="clear"></div>
 		<div class="line-dotted"></div>
 
 		<% (benchmark-result) %>

example-site/views/partials/header.html

-<head>
-	<title><% (title " - Dragonfly web framework") %></title>
-	<% (meta "author" "Marc Hildmann, Greg Slepak") %>
-	<% (meta "keywords" "newlisp, framework, dragonfly, web framework") %>
-	<% (css "screen" (web-root "includes/css/screen.css")) %>
-	<% (script (web-root "includes/js/jquery-1.3.2.min.js")) %>
-	<% (script (web-root "includes/js/dragonfly.js")) %>
-	<% (rss "Dragonfly web framework RSS Feed" (web-root "?dragonfly_rssfeed/xml")) %>
-</head>
+<title><% (title " - Dragonfly web framework") %></title>
+<%
+(meta "author" "Marc Hildmann, Greg Slepak")
+(meta "keywords" "newlisp, framework, dragonfly, web framework")
+(css "screen" (web-root "includes/css/screen.css"))
+(script (web-root "includes/js/jquery-1.3.2.min.js"))
+(script (web-root "includes/js/dragonfly.js"))
+(rss "Dragonfly web framework RSS Feed" (web-root "?dragonfly_rssfeed/xml"))
+%>

example-site/views/partials/navigation.html

 				<dt>Templates</dt>
 				<dd><% (link_to  "Creating templates" "dragonfly_views") %></dd>
 			</dl>
+			<dl class="R">
+				<dt>Core API</dt>
+				<dd><% (link_to  "Reference for Dragonfly's core API" "dragonfly_api") %></dd>
+			</dl>
 		</div>
 	</li>
 	<li>

example-site/views/setup_example.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 
 		directory into the root of your site. As an example the demo site
 		could be located here:</p>
 
-		<pre class="code">/home/user/mysite.com/dragonfly/example-site/</pre>
+		<p><span class="code">/home/user/mysite.com/dragonfly/example-site/</span></p>
 
 		<p>And to access it you would use this URL:</p>
 
-		<pre class="code">http://www.mysite.com/dragonfly/example-site/</pre>
+		<p><span class="code">http://www.mysite.com/dragonfly/example-site</span></p>
 
-		<h3 class="code">Step 1 to get it worked with Apache</h3>
-		<p>Change this line in <b>.htaccess</b></p>
+		<h3 class="code">Step 1: Update the .htaccess file</h3>
+		<p>The <b>.htaccess</b> file is a hidden file located inside the example-site folder.<br/>Change this line in <b>.htaccess</b>:</p>
 
 			<pre class="code">RewriteBase /</pre>
 			<p>To:</p>
 			<pre class="code">RewriteBase /dragonfly/example-site/</pre>
 
 
-		<h3 class="code">Step 2</h3>
+		<h3 class="code">Step 2: Update Dragonfly's configuration</h3>
 
-		<p>Edit <b>config.lsp</b> and change this line</p>
+		<p>In <span class="code">example-site/dragonfly-framework</span> you'll find the file <b>config.lsp</b>.<br/>Change this line:</p>
 
 			<pre class="code">(constant (global 'DOCUMENT_ROOT) (env "DOCUMENT_ROOT"))</pre>
 			<p>To:</p>
-			<pre class="code">(constant (global 'DOCUMENT_ROOT) "/home/user/mysite.com/dragonfly/example-site")</pre>
+			<pre class="code">(constant (global 'DOCUMENT_ROOT)
+          "/home/user/mysite.com/dragonfly/example-site")</pre>
 
 		<h3 class="code">Step 3 (optional): newLISP outside from /usr/bin/</h3>
 		<p>
 		A possible third step is required if your newlisp binary is NOT
 		installed in <b>/usr/bin/newlisp</b>.<br/><br/>If it's installed somewhere else
 		(for example: /path/to/bin/newlisp), then you may need to also
-		edit <b>index.cgi</b> file and change the top-line from:</p>
+		edit <b>index.cgi</b> file and change the top line from:</p>
 
 		<pre class="code">#!/usr/bin/env newlisp</pre>
 		<p>To:</p>

example-site/views/welcome.html

 <% (display-partial "doctype") %>
-<% (display-partial "header") %>
+<head>
+	<% (display-partial "header") %>
+</head>
 
 <body>
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.