Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix tryclj arity for when no port is supplied + wrap page content in …

…an HTML tag
  • Loading branch information...
commit 4ecb758044a24fe9f9f09941a6be380879cb07d8 1 parent ec04b39
@mpenet mpenet authored
Showing with 32 additions and 32 deletions.
  1. +32 −32 src/tryclojure/core.clj
View
64 src/tryclojure/core.clj
@@ -13,7 +13,7 @@
java.util.concurrent.TimeoutException))
(defpartial links []
- (unordered-list
+ (unordered-list
[(link-to "http://clojure.org" "The official Clojure website")
(link-to "http://dev.clojure.org/display/doc/Getting+Started" "Getting started with Clojure")
(link-to "http://groups.google.com/group/clojure" "Clojure mailing list")
@@ -37,45 +37,45 @@
"The sandbox will automatically be wiped after 15 minutes and if you evaluate more after that,"
"It'll be in an entirely new namespace/sandbox."]
[:p.bottom
- "TryClojure is written in Clojure and JavaScript (JQuery), powered by "
+ "TryClojure is written in Clojure and JavaScript (JQuery), powered by "
(link-to "https://github.com/flatland/clojail" "clojail")
" and Chris Done's "
(link-to "https://github.com/chrisdone/jquery-console" "jquery-console")]
[:p.bottom "Design by " (link-to "http://apgwoz.com" "Andrew Gwozdziewyc")])
(defpartial home-text []
- [:p.bottom
+ [:p.bottom
"Welcome to Try Clojure. Above, you have a Clojure REPL. You can type expressions and see "
"their results right here in your browser. We also have a brief tutorial to give you a "
"taste of Clojure. Try it out by typing <code class=\"expr\">tutorial</code> in the console!"])
-(defpartial fire-html []
- (:html4 doctype)
- [:head
- (include-css "/resources/public/css/tryclojure.css")
- (include-js "/resources/public/javascript/jquery-1.4.2.min.js"
- "/resources/public/javascript/jquery.console.js"
- "/resources/public/javascript/tryclojure.js")
- [:title "Try Clojure"]]
- [:body
- [:div#wrapper
- [:div#content
- [:div#header
- [:h1
- [:span.logo-try "Try"] " "
- [:span.logo-clojure "Clo" [:em "j"] "ure"]]]
- [:div#container
- [:div#console.console]
- [:div#buttons
- [:a#links.buttons "links"]
- [:a#about.buttons.last "about"]]
- [:div#changer (home-text)]]
- [:div.footer
- [:p.bottom "©2011 Anthony Grimes (Raynes) and contributors"]
- [:p.bottom
- "Built with "
- (link-to "http://webnoir.org" "Noir")
- "."]]]]])
+(defpartial fire-html []
+ (html4
+ [:head
+ (include-css "/resources/public/css/tryclojure.css")
+ (include-js "/resources/public/javascript/jquery-1.4.2.min.js"
+ "/resources/public/javascript/jquery.console.js"
+ "/resources/public/javascript/tryclojure.js")
+ [:title "Try Clojure"]]
+ [:body
+ [:div#wrapper
+ [:div#content
+ [:div#header
+ [:h1
+ [:span.logo-try "Try"] " "
+ [:span.logo-clojure "Clo" [:em "j"] "ure"]]]
+ [:div#container
+ [:div#console.console]
+ [:div#buttons
+ [:a#links.buttons "links"]
+ [:a#about.buttons.last "about"]]
+ [:div#changer (home-text)]]
+ [:div.footer
+ [:p.bottom "©2011 Anthony Grimes (Raynes) and contributors"]
+ [:p.bottom
+ "Built with "
+ (link-to "http://webnoir.org" "Noir")
+ "."]]]]]))
(defpage "/" []
(fire-html))
@@ -143,10 +143,10 @@
(defn to-port [s]
(when-let [port s] (Long. port)))
-(defn tryclj [port]
+(defn tryclj [& [port]]
(server/start
(or (to-port port)
- (to-port (System/getenv "PORT")) ;; For deploying to Heroku
+ (to-port (System/getenv "PORT")) ;; For deploying to Heroku
8801)))
(defn -main [& args] (tryclj (first args)))
Please sign in to comment.
Something went wrong with that request. Please try again.