Skip to content

Commit

Permalink
Merge branch 'master' of github.com:taoeffect/dragonfly-newlisp
Browse files Browse the repository at this point in the history
  • Loading branch information
taoeffect committed Jul 5, 2018
2 parents 3864f37 + f8e7fc3 commit f573aa4
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 24 deletions.
25 changes: 24 additions & 1 deletion CHANGES
@@ -1,3 +1,26 @@
Version 0.74

* Alpine linux support for sqlite
* Improved core error handling to avoid infinite recursion
* request.lsp now handles non-urlencoded = signs as part of value
* all code uses new date-parse function (still compatible with older newlisps)
* updated broken links in user guide
* fixed bug in dragonfly_seo

Version 0.73

* fixed cookie parsing bug

Version 0.72

* fixed bug with url8-encode

Version 0.71

* fixed bug when QUERY_STRING was empty
* speed improvement for URLencoding
* dragonfly-db is now a submodule

Version 0.7

* all code uses new ++,--,extend,write,read functions (still compatible with older newlisps)
Expand Down Expand Up @@ -176,4 +199,4 @@ Version 0.02
Version 0.01

* opened a first template called "main.tpl"
* added the first functions (css),(meta),(time-now),(form_open),(form_submit),(form_close)
* added the first functions (css),(meta),(time-now),(form_open),(form_submit),(form_close)
4 changes: 2 additions & 2 deletions README.markdown
Expand Up @@ -2,7 +2,7 @@

Congratulations on choosing Dragonfly!

Please visit http://www.rundragonfly.com/ for more information.
Please visit http://dragonfly.uberberg.com/ for more information.

#Installation

Expand All @@ -23,4 +23,4 @@ For installation information see INSTALL or after running
the above command visit:

http://localhost:8080/dragonfly_welcome (local)
http://www.rundragonfly.com/dragonfly_welcome (remote)
http://dragonfly.uberberg.com/dragonfly_welcome (remote)
3 changes: 3 additions & 0 deletions example-site/dragonfly-framework/dragonfly.lsp
Expand Up @@ -99,6 +99,9 @@
(constant (global 'write) write-buffer)
)

(when (< (sys-info -2) 10300)
(constant (global 'date-parse) parse-date))

;===============================================================================
; !Basic Setup, Global Vars, and Sanity Checks
;===============================================================================
Expand Down
4 changes: 2 additions & 2 deletions example-site/dragonfly-framework/lib/request.lsp
Expand Up @@ -141,8 +141,8 @@
(set 'data ((+ 4 (find "\r\n\r\n" chunk)) (length chunk) chunk))
(when (set 'idx (find "\r\n--" data))
(set 'data (0 idx data))
(if (set 'val (regex-captcha (string var {="(.+?)"}) disp))
($FILES var (list (list 'name val) (list 'data data) (list 'length (length data))))
(if (set 'val (regex-captcha {filename="(.+?)"} disp))
($FILES val (list (list 'name var) (list 'data data) (list 'length (length data))))
($POST var data)
)
)
Expand Down
Expand Up @@ -353,7 +353,7 @@
(dolist (idx entry-index (= max-items $idx))

(set 'entry (sxml idx))
(set 'dateseconds (parse-date (lookup 'updated entry) "%Y-%m-%dT%H:%M:%SZ")) ; convert string date to seconds
(set 'dateseconds (date-parse (lookup 'updated entry) "%Y-%m-%dT%H:%M:%SZ")) ; convert string date to seconds

(set 'contenthtml (lookup 'content entry))
(replace "&lt;br/&gt;" contenthtml "<br/>") ; we need to replace some html entities
Expand Down
Expand Up @@ -20,7 +20,7 @@
;; @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 -
;; Its features are a short learning curve, lightweight and fun in programming -
;; just like newLISP itself.</p>

;===============================================================================
Expand Down Expand Up @@ -80,7 +80,7 @@
(define (google-results-domain domain)
(set 'json (get-url (string "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q="domain)))
(begin
(regex "\"estimatedResultCount\":\"(.*)\"," json)
(regex "\"estimatedResultCount\":\"([0-9]*)\"," json)
(set 'erc $1)
)
)
Expand Down
Expand Up @@ -48,7 +48,7 @@
)
(dolist (idx entry-index)
(set 'entry (sxml idx))
(set 'dateseconds (parse-date (lookup 'published entry) "%Y-%m-%dT%H:%M:%SZ")) ; convert string date to seconds
(set 'dateseconds (date-parse (lookup 'published entry) "%Y-%m-%dT%H:%M:%SZ")) ; convert string date to seconds

(println
"<div class='entry'>"
Expand Down
8 changes: 4 additions & 4 deletions example-site/views/dragonfly_builtin_plugins.html
Expand Up @@ -51,7 +51,7 @@ <h2>Dragonfly SMTP</h2>
</ul>
<p>
This plugin (like all optional plugins) is located in the <span class="code">plugins-inactive</span> folder.
The API is <%(link_to "available here" "dragonfly_smtp_api")%>.
The API is <%(link_to "available here" "api/smtp")%>.
</p>
<h2>Dragonfly's example-site functions</h2>
<p>
Expand All @@ -69,7 +69,7 @@ <h2>Dragonfly's example-site functions</h2>
</ul>
<h2>Artful Code Modules</h2>
<p>
Dragonfly includes several of Jeff Ober's <a href="http://static.artfulcode.net/newlisp/">Artful Code modules</a>, including functions for:
Dragonfly includes several of Jeff Ober's <a href="https://github.com/kanendosei/artful-newlisp">Artful Code modules</a>, including functions for:
</p>
<ul>
<li>Session management</li>
Expand All @@ -79,12 +79,12 @@ <h2>Artful Code Modules</h2>
<li>Encoding and decoding HTML entities</li>
</ul>
<p>
Have a look in the <span class="code">plugins-inactive/artfulcode</span> folder to see the included ones. Documentation for all of Jeff's modules can be found <a href="http://static.artfulcode.net/newlisp/">here</a>.
Have a look in the <span class="code">plugins-inactive/artfulcode</span> folder to see the included ones. Documentation for all of Jeff's modules can be found <a href="https://github.com/kanendosei/artful-newlisp">here</a>.
</p>
<h2>Misc</h2>
<p>Additional plugins include:</p>
<ul>
<li>nldb.lsp - a simple list-based database by <a href="http://unbalanced-parentheses.nfshost.com/">cormullion</a></li>
<li>nldb.lsp - a simple list-based database by <a href="https://newlisper.wordpress.com/">cormullion</a></li>
</ul>
<h2>More Plugins</h2>
<p>
Expand Down
2 changes: 1 addition & 1 deletion example-site/views/dragonfly_create_routes.html
Expand Up @@ -23,7 +23,7 @@ <h1>Creating Routes</h1>
</p>
<ol>
<li>Create a .lsp file in the <span class="code">plugins-active</span> directory</li>
<li>Make a <a href="http://www.newlisp.org/index.cgi?page=newLISP-FOOP">FOOP</a> subclass of the Route class implementing its methods</li>
<li>Make a <a href="http://www.newlisp.org/downloads/newlisp_manual.html#foop">FOOP</a> subclass of the Route class implementing its methods</li>
<li>Add an instance to the <span class="code">DF:dragonfly-routes</span> list</li>
</ol>
<p>
Expand Down
2 changes: 1 addition & 1 deletion example-site/views/dragonfly_plugins.html
Expand Up @@ -21,7 +21,7 @@ <h1>Plugins</h1>
<p class="extract">You can extend and modify Dragonfly's behavior through the use of plugins.</p>

<p>
There are two types of plugins, those in the <b>plugins-active</b> folder, and those in the <b>plugins-inactive</b> folder. The ones in the former are loaded when <span class="code">listener</span> is called, prior to running the routes. Every .lsp file in the <b>plugins-active</b> folder is loaded at that point, so you'll only want your most frequently used files in there.
There are two types of plugins: those in the <b>plugins-active</b> folder, and those in the <b>plugins-inactive</b> folder. The ones in the former are loaded when <span class="code">listener</span> is called, prior to running the routes. Every .lsp file in the <b>plugins-active</b> folder is loaded at that point, so you'll only want your most frequently used files in there.

</p>

Expand Down
4 changes: 2 additions & 2 deletions example-site/views/dragonfly_routes.html
Expand Up @@ -34,7 +34,7 @@ <h2>What is a 'route'?</h2>
Then one of Dragonfly's routes (<span class="code">Route.Static</span>) sends the contents of the <b>welcome.html</b> file to your web browser (after evaluating any newLISP code inside of it).
</p>
<p>
Dragonfly's routes are represented as <a href="http://www.newlisp.org/index.cgi?page=newLISP-FOOP">FOOP objects</a> and use
Dragonfly's routes are represented as <a href="http://www.newlisp.org/downloads/newlisp_manual.html#foop">FOOP objects</a> and use
the convention of prepending "Route." to their name to avoid namespace conflicts.
</p>
<p>
Expand Down Expand Up @@ -320,7 +320,7 @@ <h3>
Q: What about nested resources?
</h3>
<p>
<span class="code">Route.Resource</span> is designed to support the creation of clean and efficient APIs (like <a href="http://apiwiki.twitter.com/Twitter-API-Documentation">twitter's</a>). Therefore it does not support nesting because:
<span class="code">Route.Resource</span> is designed to support the creation of clean and efficient APIs (like <a href="https://dev.twitter.com/overview/api">twitter's</a>). Therefore it does not support nesting because:
</p>
<h4>1. Nested resources are often unnecessary</h4>
<p>
Expand Down
2 changes: 1 addition & 1 deletion example-site/views/dragonfly_templates.html
Expand Up @@ -21,7 +21,7 @@ <h1>Templates</h1>
<p class="extract">In Dragonfly, templates are files that have newLISP code embedded in them. This code is evaluated server-side, generating a final document that's presented to visitors.</p>

<p>
Templates can be anything, but usually they're html files with newLISP code embedded in them. When you download Dragonfly, take a look at the files in <span class="code">example-site/views</span>, those are all templates, but they're also referred to as <b>views</b>.
Templates can be anything, but usually they're html files with newLISP code embedded in them. When you download Dragonfly, take a look at the files in <span class="code">example-site/views</span>. Those are all templates, but they're also referred to as <b>views</b>.
</p>
<p>
The term "view" comes from the V in MVC (<a href="http://en.wikipedia.org/wiki/Model–view–controller">model-view-controller</a>), a paradigm that Dragonfly follows only loosely (notably missing the 'model' aspect).
Expand Down
4 changes: 2 additions & 2 deletions example-site/views/dragonfly_welcome.html
Expand Up @@ -19,13 +19,13 @@

<h1>Getting Started</h1>
<p class="extract">
Setting up Dragonfly is easy, all you need is newLISP and a web server (like Apache).
Setting up Dragonfly is easy; all you need is newLISP and a web server (like Apache).
As newLISP compiles virtually everywhere, you can host a Dragonfly-based site just about anywhere,
even on shared web hosts!
</p>

<h2>At first one question</h2>
<p>Why is this guide so damn narrow? Because most people work on wide screens. So put the Dragonfly Guide on the left and open Your development window in a new browser window on the right. This way the Dragonfly User Guide will always be visible.</p>
<p>Why is this guide so damn narrow? Because most people work on wide screens. So put the Dragonfly Guide on the left and open Your development window in a new browser window on the right. This way the Dragonfly User Guide will always be visible.</p>

<h2>Requirements</h2>
<p>Dragonfly requires the following to work:</p>
Expand Down
6 changes: 3 additions & 3 deletions example-site/views/locating_self.html
Expand Up @@ -29,7 +29,7 @@ <h1>Locating Self</h1>
</p>
<h3 class="param">DF_SELF</h3>
<p>
This symbol contains the absolute path (on the server) to the main file responsible for providing an response to the requested URL, for example:
This symbol contains the absolute path (on the server) to the main file responsible for providing a response to the requested URL, for example:
</p>
<p>
<span class="code">/home/www/rundragonfly.com/views/locating_self.html</span>
Expand All @@ -42,8 +42,8 @@ <h3 class="param">DF_SELF_DIR</h3>
</p>
<h3 class="param">DF_PAGE</h3>
<p>
<span class="code">DF_PAGE</span> is useful when writing <%(link_to "templates" "dragonfly_templates")%>,
it tells us the full resource portion of the URL. For example, here's it current value:
<span class="code">DF_PAGE</span> is useful when writing <%(link_to "templates" "dragonfly_templates")%>.
It tells us the full resource portion of the URL. For example, here's it current value:
</p>
<p><span class="code"><%=DF_PAGE%></span></p>

Expand Down
2 changes: 1 addition & 1 deletion example-site/views/welcome.html
Expand Up @@ -20,7 +20,7 @@
<img src="<%=(web-root "includes/images/dragonfly_header_1.jpg")%>" class="border" alt="Dragonfly" title="Dragonfly" width="474"/>

<h1>Introduction</h1>
<p class="extract">Dragonfly is a <b>web framework for <a href="http://www.newlisp.org">newLISP</a></b>. Development started in June 2009. It focuses on <b>speed</b>, small memory consumption and a <b>small learning curve</b>. Other goodies are a plug and play architecture for plugins and a very <b>easy deployment</b>. It's possible to use it with the builtin newLISP webserver.
<p class="extract">Dragonfly is a <b>web framework for <a href="http://www.newlisp.org">newLISP</a></b>. Development started in June 2009. It focuses on <b>speed</b>, small memory consumption and a <b>small learning curve</b>. Other goodies are a plug-and-play architecture for plugins and a very <b>easy deployment</b>. It's possible to use it with the built-in newLISP webserver.
</p>

<h2>Ten reasons for tasting Dragonfly...</h2>
Expand Down

0 comments on commit f573aa4

Please sign in to comment.