Permalink
Browse files

enabled 'L5/start' to be called without a file name. now enabled to s…

…tart a presentation as just a script. and updated README (sorry, it have been too old!).
  • Loading branch information...
1 parent e5efadb commit 65470906f0a96f92312dc6f6e131df481ff2600d @fukamachi committed Dec 23, 2010
Showing with 27 additions and 12 deletions.
  1. +18 −9 README.markdown
  2. +9 −3 src/L5.clj
View
@@ -1,22 +1,31 @@
# L5 - Yet Another Presentation Tool for Lispers
-This application is a presentation tool written in Clojure. You can create slides with S-expression. See _sample.clj_ for example.
+This application is a presentation tool written in Clojure. You can create slides with S-expression. See a sample files under _sample_ directory for example.
## Installation
-You may have to ensure [Leiningen](http://github.com/technomancy/leiningen) is installed before.
+Just download **L5.jar** and run it.
-If you are ready, clone this repository and execute <code>lein deps</code>.
+ $ wget http://github.com/downloads/fukamachi/L5/L5.jar
+ $ java -jar L5.jar
- $ git clone git://github.com/fukamachi/L5
- $ cd L5
- $ lein deps
+Then a managing window appears.
## How to use?
-This application uses [lein-run](http://github.com/sids/lein-run), a plugin of Leiningen, Thanks sids!
+### Pass a file to JAR
- $ lein run presen <your-slide.clj>
+If JAR is given a file name, load it and start a presentation directory.
+
+ $ java -jar L5.jar sample/introduction-to-clojure.clj
+
+### Run as a script
+
+You hope to start your presentation as just a Clojure script, you should put a expression '(start)' to a foot of your presentation file, additionaly.
+
+ $ clj sample/introduction-to-clojure.clj
+
+## Reload the file
Then the frame appears, press &lt;Right&gt; or &lt;Space&gt; to move to next and &lt;Left&gt; or &lt;Backspace&gt; to back. Press &lt;F5&gt; to toggle fullscreen mode.
@@ -35,7 +44,7 @@ You can access to L5 during it running.
## Write slides
-See _run.clj_.
+See a sample files under _sample_ directory for example.
## Export to PDF
View
@@ -65,7 +65,9 @@
(defn doelem [elem]
(slide/normalize-element (context) elem))
-(defn reload [] (load-file @*run-file*))
+(defn reload []
+ (and @*run-file*
+ (load-file @*run-file*)))
(defn go [n]
(dosync (ref-set (:current (context)) n))
@@ -79,14 +81,18 @@
(export/jframe->pdf output (context))
(go 0))
-(defn start [file]
+(defn start [& [file]]
(when (not @*server-socket*)
(dosync (ref-set *server-socket* (create-repl-server 12345 25))))
- (dosync (ref-set *run-file* file))
+
+ (if file (dosync (ref-set *run-file* file)))
+
(reload)
+
(attach-event KeyEvent/VK_R #(reload))
(attach-event KeyEvent/VK_E (fn [] (file/save-dialog @(:frame (context)) #(export %) file/pdf-filter)))
(attach-event KeyEvent/VK_Q #(System/exit 0))
+
(context/start (context)))
(defn select-file []

0 comments on commit 6547090

Please sign in to comment.