Skip to content

Commit

Permalink
Replaced cljs-tui-demo gif to include updated credits
Browse files Browse the repository at this point in the history
  • Loading branch information
jaidetree committed Mar 8, 2019
1 parent 1ada954 commit 3eed778
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
Binary file modified doc/cljs-tui-demo.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 11 additions & 12 deletions resources/leiningen/new/cljs_tui/env/dev/app.cljs
Expand Up @@ -22,21 +22,10 @@
Takes list of cli args, parses into opts map, inserts opts into re-frame db
then initializes the ui.
Returns nil but mostly invokes side-effects.
Source for this came from:
https://gist.github.com/polymeris/5e117676b79a505fe777df17f181ca2e#file-core-cljs-L105"
Returns nil but mostly invokes side-effects."
[& args]
(main/init! ui :opts (main/args->opts args)))

(defn log-fn
"A log handler function to append messages to our debug/logger atom.
Takes variadic arguments, typically strings or stringifiable args.
Appends string of all args to log."
[& args]
(swap! debug/logger conj (clojure.string/join " " args)))

(defn {{#figwheel-main?}}^:after-load {{/figwheel-main?}}reload!
"Called when dev env is reloaded. Re-renders the ui and logs a message."
[_]
Expand All @@ -45,6 +34,16 @@
(render @screen))
(println "Reloading app"))

(defn log-fn
"A log handler function to append messages to our debug/logger atom.
Takes variadic arguments, typically strings or stringifiable args.
Appends string of all args to log.
Source for this came from:
https://gist.github.com/polymeris/5e117676b79a505fe777df17f181ca2e#file-core-cljs-L105"
[& args]
(swap! debug/logger conj (clojure.string/join " " args)))

;; Override the console.* messages to use our log-fn. Later if we call
;; console.log or println the message shows up in our debug box.

Expand Down
13 changes: 10 additions & 3 deletions resources/leiningen/new/cljs_tui/env/dev/debug/views.cljs
Expand Up @@ -2,7 +2,8 @@
"General debug views. These wont be included in your production build by default.
Portions based on:
https://github.com/denisidoro/floki/blob/167b6da56fdee86043d34514b352c732fdfc3487/src/floki/debug/view.cljs"
https://github.com/denisidoro/floki/blob/167b6da56fdee86043d34514b352c732fdfc3487/src/floki/debug/view.cljs
and https://gist.github.com/polymeris/5e117676b79a505fe777df17f181ca2e"
(:require
[clojure.pprint :refer [pprint]]
[clojure.string :refer [join]]
Expand All @@ -25,7 +26,10 @@
"Display a box that shows the last several lines of logged output based on
screen height.
Can be thrown off by multi-line lines of text.
Returns hiccup vector."
Returns hiccup vector.
Source inspired by:
https://gist.github.com/polymeris/5e117676b79a505fe777df17f181ca2e"
[rows]
[:box#log
{:top 0
Expand All @@ -50,7 +54,10 @@
"Displays both the current state and last several lines of output.
Takes number of rows representing the total screen height.
Will display in the bottom half of the screen.
Returns hiccup vector."
Returns hiccup vector.
Source for this came from:
https://gist.github.com/polymeris/5e117676b79a505fe777df17f181ca2e"
[rows]
[:text#debug {:bottom 0
:left 0
Expand Down

0 comments on commit 3eed778

Please sign in to comment.