mirror of https://github.com/status-im/reagent.git
Add some copy
This commit is contained in:
parent
97da42101a
commit
969b63cd00
|
@ -11,20 +11,23 @@
|
||||||
"index.html" intro/main
|
"index.html" intro/main
|
||||||
"news/index.html" news/main)
|
"news/index.html" news/main)
|
||||||
|
|
||||||
|
(def github {:href "https://github.com/holmsand/reagent"})
|
||||||
|
|
||||||
(defn github-badge []
|
(defn github-badge []
|
||||||
[:a.github-badge
|
[:a.github-badge
|
||||||
{:href "https://github.com/holmsand/reagent"}
|
github
|
||||||
[:img {:style {:position "absolute" :top 0 :left 0 :border 0}
|
[:img {:style {:position "absolute" :top 0 :left 0 :border 0}
|
||||||
:src "https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png"
|
:alt "Fork me on GitHub"
|
||||||
:alt "Fork me on GitHub"}]])
|
:src "https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png"}]])
|
||||||
|
|
||||||
(defn demo []
|
(defn demo []
|
||||||
[:div
|
[:div
|
||||||
[:div.nav
|
[:div.nav
|
||||||
[:ul.nav
|
[:ul.nav
|
||||||
[:li.brand [link {:href intro/main} "Reagent:"]]
|
[:li.brand [link {:href intro/main} "Reagent:"]]
|
||||||
[:li [link {:href intro/main} "Introduction"]]
|
[:li [link {:href intro/main} "Intro"]]
|
||||||
[:li [link {:href news/main} "News"]]]]
|
[:li [link {:href news/main} "News"]]
|
||||||
|
[:li [:a github "GitHub"]]]]
|
||||||
(let [comp (get @page-map @page intro/main)]
|
(let [comp (get @page-map @page intro/main)]
|
||||||
[comp])
|
[comp])
|
||||||
[github-badge]])
|
[github-badge]])
|
||||||
|
|
|
@ -45,11 +45,40 @@
|
||||||
(remove-watch state ::undo-watcher))}))
|
(remove-watch state ::undo-watcher))}))
|
||||||
|
|
||||||
(defn undo-example []
|
(defn undo-example []
|
||||||
(let [head "This should become news"]
|
(let [head "Cloact becomes Reagent: Undo is trivial"]
|
||||||
[:div.reagent-demo
|
[:div.reagent-demo
|
||||||
[:h1 [link {:href undo-example} head]]
|
[:h1 [link {:href undo-example} head]]
|
||||||
[title head]
|
[title head]
|
||||||
[undo-demo-cleanup]]))
|
[:div.demo-text
|
||||||
|
[:h2 "(reset! cloact-name \"Reagent\")"]
|
||||||
|
|
||||||
|
[:p "It turns out that ”Cloact” was a really, really bad
|
||||||
|
name. It made some people think about birds’ behinds, in
|
||||||
|
possibly unhealthy ways, which even Google suggested they
|
||||||
|
should."]
|
||||||
|
|
||||||
|
[:p "The new name is " [:strong "Reagent"] ", which hopefully
|
||||||
|
doesn’t bring with it the same disgusting connotations."]
|
||||||
|
|
||||||
|
[:p "The API is otherwise unchanged, so a simple
|
||||||
|
search-and-replace should suffice."]
|
||||||
|
|
||||||
|
[:h2 "Undo the easy way"]
|
||||||
|
|
||||||
|
[:p "To celebrate the undoing of the apparently disgusting name,
|
||||||
|
here is an example of how easy it is to add undo functionality
|
||||||
|
to Reagent components."]
|
||||||
|
|
||||||
|
[:p "It simply saves the old state whenever it changes, and
|
||||||
|
restores it when the button is clicked."]
|
||||||
|
|
||||||
|
[:p "The really nice thing about ClojureScript is that not only
|
||||||
|
is this easy and safe to do, courtesy of immutable data
|
||||||
|
structures, it is also efficient. ClojureScript figures out how
|
||||||
|
to represent ”changes” to maps and vectors efficiently, so that
|
||||||
|
you won’t have to."]
|
||||||
|
|
||||||
|
[undo-demo-cleanup]]]))
|
||||||
|
|
||||||
(defn main []
|
(defn main []
|
||||||
[undo-example])
|
[undo-example])
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
div.nav {
|
div.nav {
|
||||||
/* background-color: #f00; */
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
@ -99,6 +98,8 @@ ul.nav > li.brand > a {
|
||||||
}
|
}
|
||||||
|
|
||||||
.reagent-demo h2 {
|
.reagent-demo h2 {
|
||||||
|
font-size: 20px;
|
||||||
|
line-height: 1.25em;
|
||||||
margin-top: 48px;
|
margin-top: 48px;
|
||||||
color: #555;
|
color: #555;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +107,7 @@ ul.nav > li.brand > a {
|
||||||
.demo-text > p, .demo-text > ul {
|
.demo-text > p, .demo-text > ul {
|
||||||
font-family: georgia, serif;
|
font-family: georgia, serif;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 27px;
|
line-height: 1.5em;
|
||||||
color: #444;
|
color: #444;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue