Skip to content

Commit 848ef31

Browse files
committed
add logo and badges
1 parent e2daa69 commit 848ef31

26 files changed

+159
-38
lines changed

.gitignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ figwheel_server.log
88
.lein-repl-history
99
pom.xml
1010
node_modules/
11-
docs/out/*.html
12-
/out
13-
pom.xml.asc
11+
out/
12+
docs/out/
13+
pom.xml.asc
14+
build.xml

README.md

+18-21
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
<h1><a href="https://github.com/domino-clj/domino">Domino</a></h1>
21

3-
[![Clojars Project](https://img.shields.io/clojars/v/domino/core.svg)](https://clojars.org/domino/core)
2+
<h1><img src="logo/logo.png" title="" style="margin-bottom: -10px; margin-right: 10px;" width="85px"><a href="https://github.com/domino-clj/domino">Domino</a></h1>
43

5-
[](https://circleci.com/gh/domino-clj/domino)
4+
[![CircleCI](https://img.shields.io/circleci/build/gh/domino-clj/domino?label=CircleCI&logo=circleci&style=flat-square)](https://circleci.com/gh/domino-clj/domino) [![Clojars Project](https://img.shields.io/clojars/v/domino/core?&style=flat-square)](https://clojars.org/domino/core) [![Slack](https://img.shields.io/badge/slack-%40clojurians%2Fdomino--clj-blue?logo=slack&style=flat-square)](https://clojurians.slack.com/messages/domino-clj) [![Clojars Downloads](https://img.shields.io/clojars/dt/domino/core?color=blue&style=flat-square)](https://clojars.org/domino/core) [![GitHub Stars](https://img.shields.io/github/stars/domino-clj/domino?logo=github&style=flat-square)](https://github.com/domino-clj/domino/stargazers)
65

76

8-
[![CircleCI](https://circleci.com/gh/domino-clj/domino.svg?style=svg)](https://circleci.com/gh/domino-clj/domino)
9-
107
<h3 class="hidden">See <a href="https://domino-clj.github.io">here</a> for interactive documentation.</h3>
118

129
Domino is a data flow engine that helps you organize the interactions between your data model and events. Domino allows you to declare your business logic using a directed acyclic graph of events and effects. Whenever an external change is transacted to the data model, the graph determines the chain of events that will be executed, and side effects triggered as a result of the computation.
@@ -19,19 +16,19 @@ Domino explicitly separates logic that makes changes to the data model from side
1916

2017
Domino consists of three main concepts:
2118

22-
**1. Model**
19+
### 1. Model
2320

24-
The model represents the paths within an EDN data structure. These paths will typically represent fields within a document. Each path entry is a tuple where the first value is the path segment, and the second value is the metadata associated with it. If the path is to be used for effects and/or events, the metadata must contain the `:id` key.
21+
The model represents the paths within an EDN data structure. These paths will typically represent fields within a document. Each path entry is a tuple where the first value is the path segment, and the second value is the metadata associated with it. If the path is to be used for effects and/or events, the metadata must contain the `:id` key.
2522

26-
For example, `[:amount {:id :amount}]` is the path entry to the `:amount` key within the data model and can be referenced in your events and effects as `:amount` (defined by the `:id`). You can nest paths within each other, such as the following model definition:
23+
For example, `[:amount {:id :amount}]` is the path entry to the `:amount` key within the data model and can be referenced in your events and effects as `:amount` (defined by the `:id`). You can nest paths within each other, such as the following model definition:
2724

2825
```clojure
2926
[[:patient [:first-name {:id :fname}]]]
3027
```
3128

32-
**2. Events**
29+
### 2. Events
3330

34-
The events define the business logic associated with the changes of the model. Whenever a value is transacted, associated events are computed. Events are defined by three keys; an `:inputs` vector, an `:outputs` vector, and a `:handler` function.
31+
The events define the business logic associated with the changes of the model. Whenever a value is transacted, associated events are computed. Events are defined by three keys; an `:inputs` vector, an `:outputs` vector, and a `:handler` function.
3532

3633
The handler accepts three arguments: a context containing the current state of the engine, a list of the input values, and a list of the output values. The function should produce a vector of outputs matching the declared `:outputs` key. For example:
3734

@@ -45,7 +42,7 @@ The handler accepts three arguments: a context containing the current state of t
4542
It's also possible to declare async events by providing the `:async?` key, e.g:
4643

4744
```clojure
48-
{:async? true
45+
{:async? true
4946
:inputs [:amount]
5047
:outputs [:total]
5148
:handler (fn [ctx {:keys [amount]} {:keys [total]} callback]
@@ -55,17 +52,17 @@ It's also possible to declare async events by providing the `:async?` key, e.g:
5552
Async event handler takes an additional argument that specifies the callback function
5653
that should be called with the result.
5754

58-
**3. Effects**
55+
### 3. Effects
5956

6057
Effects are used for effectful operations, such as IO, that happen at the edges of
61-
the computation. The effects do not cascade. An effect can contain the following keys:
58+
the computation. The effects do not cascade. An effect can contain the following keys:
6259

6360
* `:id` - optional unique identifier for the event
6461
* `:inputs` - optional set of inputs that trigger the event to run when changed
6562
* `:outputs` - optional set of outpus that the event will produce when running the handler
6663
* `:handler` - a function that handles the business logic for the effect
6764

68-
#### incoming effects
65+
#### Incoming Effects
6966

7067
Effects that declare `:outputs` are used to generate the initial input to the
7168
engine. For example, an effect that injects a timestamp can look as follows:
@@ -83,9 +80,9 @@ event ids, e.g: `(trigger-effects ctx [:timestamp])`.
8380

8481
The handler accepts two arguments: a context containing the current state of the engine, and a list of output values.
8582

86-
#### outgoing effects
83+
#### Outgoing Effects
8784

88-
Effects that declare `:inputs` will be run after events have been transacted and the new context is produced. These effects are defined as a map of `:inputs` and a `:handler` function.
85+
Effects that declare `:inputs` will be run after events have been transacted and the new context is produced. These effects are defined as a map of `:inputs` and a `:handler` function.
8986

9087
The handler accepts two arguments: a context containing the current state of the engine, and a list of input values.
9188

@@ -114,7 +111,7 @@ Let's take a look at a simple engine that accumulates a total. Whenever an amoun
114111
(def schema
115112
{:model [[:amount {:id :amount}]
116113
[:total {:id :total}]]
117-
:events [{:id :update-total
114+
:events [{:id :update-total
118115
:inputs [:amount]
119116
:outputs [:total]
120117
:handler (fn [ctx {:keys [amount]} {:keys [total]}]
@@ -131,7 +128,7 @@ This schema declaration is a map containing three keys:
131128
* The `:events` key contains pure functions that represent events that are triggered when their inputs change. The events produce updated values that are persisted in the state.
132129
* The `:effects` key contains the functions that produce side effects based on the updated state.
133130

134-
Using a unified model referenced by the event functions allows us to easily tell how a particular piece of business logic is triggered.
131+
Using a unified model referenced by the event functions allows us to easily tell how a particular piece of business logic is triggered.
135132

136133
The event engine generates a direct acyclic graph (DAG) based on the `:input` keys declared by each event that's used to compute the new state in a transaction. This approach removes any ambiguity regarding when and how business logic is executed.
137134

@@ -195,7 +192,7 @@ if the context is authorized before running the events as follows:
195192
{:model [[:foo {:id :foo
196193
:pre [(fn [handler]
197194
(fn [ctx inputs outputs]
198-
;;only run the handler if ctx contains
195+
;; only run the handler if ctx contains
199196
;; :authorized key
200197
(when (:authorized ctx)
201198
(handler ctx inputs outputs))))]
@@ -226,7 +223,7 @@ Effects can act as inputs to the data flow engine. For example, this might happe
226223
:handler (fn [_ current-state]
227224
(update current-state :total inc))}]}
228225
{:total 0})]
229-
226+
230227
(:domino.core/db (domino.core/trigger-effects ctx [:increment-total])))
231228
```
232229

@@ -250,7 +247,7 @@ This wraps up everything you need to know to start using Domino. You can see a m
250247

251248
## License
252249

253-
Copyright © 2019
250+
Copyright © 2019
254251

255252
Distributed under the Eclipse Public License either version 1.0 or (at
256253
your option) any later version.

docs/compile.cljs

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[cljs.tools.reader.reader-types :refer [string-push-back-reader read-char]]
66
[clojure.string :as string]
77
[markdown.core :as markdown]
8-
["fs" :as fs]
8+
["fs-extra" :as fs]
99
["nunjucks" :as nj])
1010
(:import goog.string.StringBuffer))
1111

@@ -35,8 +35,13 @@
3535

3636
;;================= MAIN ============================
3737
(let [readme (slurp (path ".." "README.md"))
38-
docs (try (fs/readdirSync "md" #js{:encoding "UTF-8"}) (catch js/Error _))]
38+
docs (try (fs/readdirSync "md" #js{:encoding "UTF-8"}) (catch js/Error _))
39+
resources (try (fs/readdirSync "resources" #js{:encoding "UTF-8"}) (catch js/Error _))]
3940

41+
(fs/copySync (path ".." "logo") (path "out" "logo"))
42+
(doseq [resource resources]
43+
(fs/copySync (path "resources" resource) (path "out" resource)))
44+
4045
(spit
4146
(path "out" "index.html")
4247
(nj/render

docs/package-lock.json

+24-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"dependencies": {
55
"lumo-cljs": "1.10.1",
66
"nunjucks": "3.1.7",
7-
"markdown-clj": "1.10.1"
7+
"markdown-clj": "1.10.1",
8+
"fs-extra": "8.1.0"
89
},
910
"scripts": {
1011
"start": "./compile.cljs"
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/out/style.css docs/resources/style.css

+10-9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ body {
1010
}
1111

1212
h1, h2, h3, h4, h5, h6 {
13-
color: #000;
1413
line-height: 1;
1514
}
1615

@@ -19,32 +18,34 @@ h1 {
1918
}
2019

2120
h2 {
22-
font-size: 1.85em
21+
font-size: 1.85em;
22+
padding-bottom: 0.3em;
23+
border-bottom: 1px solid #eaecef;
2324
}
2425

2526
h3 {
26-
font-size: 1.5em
27+
font-size: 1.35em
2728
}
2829

2930
h4 {
30-
font-size: 1.375em
31+
font-size: 1.2em
3132
}
3233

3334
h5 {
34-
font-size: 1.25em
35+
font-size: 1.15em
3536
}
3637

3738
h6 {
38-
font-size: 1.125em
39+
font-size: 1.1em
3940
}
4041

4142
a {
4243
text-decoration: none;
43-
color: #09f;
44+
color: #4165a2;
4445
}
4546

4647
a:hover {
47-
text-decoration: underline;
48+
border-bottom: 1px dotted black;
4849
}
4950
pre {
5051
font-size: 16px;
@@ -62,4 +63,4 @@ pre {
6263

6364
.hidden {
6465
display: none;
65-
}
66+
}

docs/templates/page.html

+8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
<link rel="stylesheet" type="text/css" href="style.css">
1717
<link rel="stylesheet" type="text/css" href="highlight.pack.css">
1818

19+
<link rel="apple-touch-icon" sizes="180x180" href="logo/apple-touch-icon.png">
20+
<link rel="icon" type="image/png" sizes="32x32" href="logo/favicon-32x32.png">
21+
<link rel="icon" type="image/png" sizes="16x16" href="logo/favicon-16x16.png">
22+
<link rel="manifest" href="logo/site.webmanifest">
23+
<link rel="mask-icon" href="logo/safari-pinned-tab.svg" color="#74a995">
24+
<meta name="msapplication-TileColor" content="#74a995">
25+
<meta name="theme-color" content="#ffffff">
26+
1927
</head>
2028

2129
<body>

logo/android-chrome-192x192.png

5.47 KB
Loading

logo/android-chrome-512x512.png

15.5 KB
Loading

logo/apple-touch-icon.png

4.96 KB
Loading

logo/browserconfig.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<browserconfig>
3+
<msapplication>
4+
<tile>
5+
<square150x150logo src="/mstile-150x150.png"/>
6+
<TileColor>#74a995</TileColor>
7+
</tile>
8+
</msapplication>
9+
</browserconfig>

logo/favicon-16x16.png

962 Bytes
Loading

logo/favicon-32x32.png

1.43 KB
Loading

logo/favicon.ico

14.7 KB
Binary file not shown.

logo/logo.png

62 KB
Loading

logo/logo.svg

+3
Loading

logo/mstile-144x144.png

3.26 KB
Loading

logo/mstile-150x150.png

3.32 KB
Loading

logo/mstile-310x150.png

3.68 KB
Loading

logo/mstile-310x310.png

7.21 KB
Loading

logo/mstile-70x70.png

2.32 KB
Loading

logo/safari-pinned-tab.svg

+55
Loading

logo/site.webmanifest

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "",
3+
"short_name": "",
4+
"icons": [
5+
{
6+
"src": "/android-chrome-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "/android-chrome-512x512.png",
12+
"sizes": "512x512",
13+
"type": "image/png"
14+
}
15+
],
16+
"theme_color": "#ffffff",
17+
"background_color": "#ffffff",
18+
"display": "standalone"
19+
}

0 commit comments

Comments
 (0)