Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

better markdown

  • Loading branch information...
commit 870d80156b8379fd7ad6ef7c917accccc5e720f4 1 parent af15097
@joegallo authored
Showing with 21 additions and 15 deletions.
  1. +21 −15 README.md
View
36 README.md
@@ -12,8 +12,9 @@ Add this to your project.clj :dependencies list:
(use '[doric.core :only [table]])
- ;; Rows are maps, columns are entries in the maps. Column titles
- ;; are driven from the keys, by default, :like-this becomes Like This.
+Rows are maps, columns are entries in the maps. Column titles are
+driven from the keys, by default, :like-this becomes Like This.
+
> (print (table [{:a 1 :b 2}]))
|---+---|
| A | B |
@@ -21,7 +22,8 @@ Add this to your project.clj :dependencies list:
| 1 | 2 |
|---+---|
- ;; the formatting is emacs org-mode tables, which are awesome
+The formatting is emacs org-mode tables, which are awesome.
+
> (print (table [{:a 1 :b 2 :c 3}{:a 4 :b 5 :c 6}]))
|---+---+---|
| A | B | C |
@@ -30,8 +32,9 @@ Add this to your project.clj :dependencies list:
| 4 | 5 | 6 |
|---+---+---|
- ;; individual columns are optional, each column automatically
- ;; sizes itself to hold the data
+Individual columns are optional, each column automatically sizes
+itself to hold the data.
+
> (print (table [{:lang "Clojure" :strength "strong" :safety "safe"}
{:lang "Java" :strength "strong" :safety "safe"}
{:lang "JavaScript" :strength "weak"}]))
@@ -43,7 +46,8 @@ Add this to your project.clj :dependencies list:
| JavaScript | weak | |
|------------+----------+--------|
- ;; an optional first vector lets you reorder your columns
+An optional first vector lets you reorder your columns.
+
> (print (table [:lang :safety :strength]
[{:lang "Clojure" :strength "strong" :safety "safe"}
{:lang "Java" :strength "strong" :safety "safe"}
@@ -56,8 +60,9 @@ Add this to your project.clj :dependencies list:
| JavaScript | | weak |
|------------+--------+----------|
- ;; or, you can substitute (per column) a map for a keyword, and
- ;; change the way the data is displayed
+Or, you can substitute (per column) a map for a keyword, and change
+the way the data is displayed.
+
> (print (table [{:name :lang :title "Language" :align :center :width 12}
{:name :safety :width 12 :align :left}
{:name :strength :width 12 :align :left}]
@@ -72,13 +77,14 @@ Add this to your project.clj :dependencies list:
| JavaScript | | weak |
|--------------+--------------+--------------|
- ;; column level options include:
- ;; :align -- :left, :right, :center, defaults to :left
- ;; :title -- a string, defaults to your column name, title-cased
- ;; :title-align -- defaults to the same as align
- ;; :when -- a boolean, allows you to turn columns on and off
- ;; :width -- how wide to make the column, defaults to wide enough
- ;; :format -- a function to call on the values in the column, pre-output
+Column level options include:
+
+* :align - :left, :right, :center, defaults to :left
+* :title - a string, defaults to your column name, title-cased
+* :title-align - like align, and defaults to the same as :align
+* :when - a boolean, allows you to turn columns on and off
+* :width - how wide to make the column, defaults to wide enough
+* :format - a function to call on the values in the column, pre-output
## License

0 comments on commit 870d801

Please sign in to comment.
Something went wrong with that request. Please try again.