Skip to content

Commit

Permalink
updated docs, better rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
jexp committed Jul 4, 2012
1 parent 1f3c5ac commit ec6ad16
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# trycypher
# Try Cypher

TryClojure is a online Clojure REPL written using Noir and Chris Done's jquery console (you're awesome, Chris).
TryCypher is a online Neo4j Cypher REPL und Tutorial written using TryClojure, Noir and Chris Done's jquery console.

## Usage

http://tryclj.com
http://trycypher.heroku.com

If you want to run it, refer to https://github.com/Raynes/trycypher/wiki/Running-Tryclojure
If you want to run it, refer to https://github.com/Raynes/tryclojure/wiki/Running-Tryclojure

## Credits

apgwoz: Design
Raynes: TryClojure

## License

Expand Down
9 changes: 7 additions & 2 deletions src/trycypher/models/cypher.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
)

(defn cypher-convert-cell [[col value]]
[col (cypher-convert-value value)])
[col (render (cypher-convert-value value))])

(defn cypher-convert-row [row] (map cypher-convert-value row))
(defn cypher-convert-row [row] (map #(render (cypher-convert-value %)) row))

(defn cypher-convert-result [row] (map cypher-convert-cell row))

Expand All @@ -23,6 +23,11 @@
([row] (pad row "|" "\n"))
)

(defn render [value]
(if (coll? value) (doall (flatten (seq value))) value)
)


(defn result-to-table [{data :data columns :columns}]
(str (pad columns) (apply str (map pad (map cypher-convert-row data)))))

Expand Down

0 comments on commit ec6ad16

Please sign in to comment.