Skip to content

Commit df8047b

Browse files
committed
Add references to example code
1 parent cb061b0 commit df8047b

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

index.adoc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ dependency, and setup an alias to execute it.
6161
To achieve this, create a new `deps.edn` file with the following
6262
content:
6363

64+
.deps.edn
6465
[,clojure]
6566
----
6667
{:deps {org.clojure/clojure {:mvn/version "1.12.0"}
@@ -110,8 +111,9 @@ $ duct --init
110111
Created duct.edn
111112
----
112113

113-
This will create a file, `duct.edn` with the content:
114+
This will create a file: `duct.edn`.
114115

116+
.duct.edn
115117
[,clojure]
116118
----
117119
{:system {}}
@@ -121,8 +123,9 @@ This will create a file, `duct.edn` with the content:
121123

122124
As mentioned previously, Duct uses a file, `duct.edn`, to define the
123125
structure of your application. We'll begin by adding a new component
124-
key to the system:
126+
key to the system.
125127

128+
.duct.edn
126129
[,clojure]
127130
----
128131
{:system
@@ -152,6 +155,7 @@ mkdir -p src/tutorial
152155

153156
Then a minimal Clojure file at: `src/tutorial/print.clj`.
154157

158+
.src/tutorial/print.clj
155159
[,clojure]
156160
----
157161
(ns tutorial.print)
@@ -231,8 +235,9 @@ A *module* groups multiple components together. Duct provides a number
231235
of pre-written modules that implement common functionality. One of these
232236
modules is `:duct.module/logging`.
233237

234-
We'll first add the dependency to `deps.edn`.
238+
We'll first add the new dependency:
235239

240+
.deps.edn
236241
[,clojure]
237242
----
238243
{:deps {org.clojure/clojure {:mvn/version "1.12.0"}
@@ -241,8 +246,9 @@ We'll first add the dependency to `deps.edn`.
241246
:aliases {:duct {:main-opts ["-m" "duct.main"]}}}
242247
----
243248

244-
Then we'll add the module to the `duct.edn` configuration.
249+
Then we'll add the module to the Duct configuration.
245250

251+
.duct.edn
246252
[,clojure]
247253
----
248254
{:system
@@ -290,6 +296,7 @@ to a file, `logs/repl.log`.
290296
In order to use this module, we need to connect the logger to our
291297
'`hello`' component. This is done via a *ref*.
292298

299+
.duct.edn
293300
[,clojure]
294301
----
295302
{:system
@@ -310,6 +317,7 @@ applications.
310317
Now that we've connected the components together in the configuration
311318
file, it's time to replace the `println` function with the Duct logger.
312319

320+
.src/tutorial/print.clj
313321
[,clojure]
314322
----
315323
(ns tutorial.print
@@ -356,6 +364,7 @@ environment variable or command line option. Duct allows variables, or
356364
Currently our application outputs the same log message each time it's
357365
run. Let's create a configuration var to customize that behavior.
358366

367+
.duct.edn
359368
[,clojure]
360369
----
361370
{:vars
@@ -370,6 +379,7 @@ run. Let's create a configuration var to customize that behavior.
370379
Then in the source file we can add the `:name` option that the var is
371380
attached to.
372381

382+
.src/tutorial/print.clj
373383
[,clojure]
374384
----
375385
(ns tutorial.print
@@ -434,6 +444,7 @@ behavior to the environment they're being run under. We can also use the
434444

435445
Let's change our component to allow for the log level to be specified.
436446

447+
.src/tutorial/print.clj
437448
[,clojure]
438449
----
439450
(ns tutorial.print
@@ -446,6 +457,7 @@ Let's change our component to allow for the log level to be specified.
446457
In `duct.edn` we can use a profile to change the log level depending
447458
on whether the application uses the `:main` or `:repl` profile.
448459

460+
.deps.edn
449461
[,clojure]
450462
----
451463
{:vars

0 commit comments

Comments
 (0)