Skip to content

Commit 6119718

Browse files
committed
Merge branch 'doc-restyle'
2 parents c73e343 + 710d0ba commit 6119718

File tree

9 files changed

+361
-53
lines changed

9 files changed

+361
-53
lines changed

bb.edn

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
{:depends [mkdirs]
1111
:task (doseq [[src dest] {"site/logo.svg" "build/logo.svg"
1212
"site/index.html" "build/index.html"
13-
"site/style.css" "build/style.css"}]
13+
"site/style.css" "build/style.css"
14+
"docs/style.css" "build/docs/style.css"
15+
"docs/reset.css" "build/docs/reset.css"}]
1416
(fs/copy src dest {:replace-existing true}))}
1517
build
1618
{:depends [docstrings files]
17-
:task (shell "asciidoctor -D build/docs -b html5 index.adoc")}}}
19+
:task (shell "asciidoctor -D build/docs -b html5 docs/index.adoc")}}}

build.clj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767

6868
(ig/load-annotations)
6969

70-
(with-open [writer (io/writer "keywords.adoc")]
70+
(with-open [writer (io/writer "docs/keywords.adoc")]
7171
(binding [*out* writer]
7272
(println "[.concise-index]")
7373
(println ".Index")
@@ -82,8 +82,7 @@
8282
(println "[discrete]")
8383
(println "###" kw)
8484
(newline)
85-
(println (str "*Dependency:* `"
86-
(get-dependency (find-resource kw)) "`"))
85+
(println (str "`" (get-dependency (find-resource kw)) "`"))
8786
(newline)
8887
(println doc)))))
8988

docinfo.html

Lines changed: 0 additions & 24 deletions
This file was deleted.

docs/docinfo.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<link rel="preconnect" href="https://fonts.googleapis.com">
2+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3+
<link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Bebas+Neue&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet">
4+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/solid.min.css" integrity="sha512-EHa6vH03/Ty92WahM0/tet1Qicl76zihDCkBnFhN3kFGQkC+mc86d7V+6y2ypiLbk3h0beZAGdUpzfMcb06cMg==" crossorigin="anonymous" referrerpolicy="no-referrer">
5+
<link href="style.css" rel="stylesheet">

index.adoc renamed to docs/index.adoc

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
= The Duct Framework
1+
= Duct
22
James Reeves
33
{docdate}
44
:doctype: book
55
:encoding: UTF-8
66
:lang: en
7-
:source-highlighter: coderay
7+
:source-highlighter: highlight.js
8+
:highlightjs-theme: ir-black
9+
:highlightjs-languages: clojure, clojure-repl, json, shell
810
:sectnums:
11+
:linkcss:
12+
:stylesheet: reset.css
913
:toc: left
14+
:title: The Duct Framework
1015
:url-repo: https://github.com/duct-framework/duct-framework.github.io
1116
:experimental:
1217
:docinfo: shared
1318

19+
[discrete]
20+
= The Duct Framework
21+
1422
== Introduction
1523

1624
Duct is a framework for developing server-side applications in the
@@ -215,7 +223,7 @@ user=>
215223
In the REPL environment the system will not be initiated automatically.
216224
Instead, we use the inbuilt `(go)` function.
217225

218-
[,clojure]
226+
[,clojure-repl]
219227
----
220228
user=> (go)
221229
Hello World
@@ -226,7 +234,7 @@ The REPL can be left running while source files updated. The `(reset)`
226234
function will halt the running system, reload any modified source files,
227235
then initiate the system again.
228236

229-
[,clojure]
237+
[,clojure-repl]
230238
----
231239
user=> (reset)
232240
:reloading (tutorial.print)
@@ -239,7 +247,7 @@ You can also use the kbd:[Alt-E] hotkey instead of typing `(reset)`.
239247
The configuration defined by `duct.edn` can be accessed with `config`,
240248
and the running system can be accessed with `system`.
241249

242-
[,clojure]
250+
[,clojure-repl]
243251
----
244252
user=> config
245253
#:tutorial.print{:hello {}}
@@ -509,7 +517,7 @@ $ duct --main
509517

510518
But when using the REPL, we get a more concise message.
511519

512-
[,shell]
520+
[,clojure-repl]
513521
----
514522
user=> (go)
515523
:initiated
@@ -806,9 +814,9 @@ we have no routes defined. The error page will be in plaintext, because
806814
we haven't specified what _features_ we want for our web application.
807815

808816
We'll fix both these issues, but before we do we should terminate the
809-
application with Ctrl-C and start a REPL. We'll keep this running while
810-
we develop the application to avoid costly restarts and to give us a way
811-
of querying the running system.
817+
application with kbd:[Ctrl-C] and start a REPL. We'll keep this running
818+
while we develop the application to avoid costly restarts and to give
819+
us a way of querying the running system.
812820

813821
[,shell]
814822
----
@@ -859,7 +867,7 @@ returns a Hiccup data structure.
859867

860868
Finally, we trigger a `(reset)` at the REPL.
861869

862-
[,shell]
870+
[,clojure-repl]
863871
----
864872
user=> (reset)
865873
:reloading (todo.routes)
@@ -1118,7 +1126,7 @@ Our project dependencies should now look like this:
11181126
We can load these new dependencies either by restarting the REPL, or by
11191127
using the `sync-deps` function.
11201128

1121-
[,clojure]
1129+
[,clojure-repl]
11221130
----
11231131
user=> (sync-deps)
11241132
[...]
@@ -1139,7 +1147,7 @@ The next step is to add `:duct.module/sql` to our Duct configuration.
11391147

11401148
Then reset via the REPL:
11411149

1142-
[,shell]
1150+
[,clojure-repl]
11431151
----
11441152
user=> (reset)
11451153
:reloading ()
@@ -1174,7 +1182,7 @@ used in development.
11741182
If we want to change this in production, we can use the corresponding
11751183
command-line argument or environment variable to override this default.
11761184

1177-
[,shell]
1185+
[,clojure-repl]
11781186
----
11791187
user=> (reset)
11801188
:reloading ()
@@ -1277,7 +1285,7 @@ create a table to store the todo list items.
12771285

12781286
When we reset the REPL, the migration is automatically applied.
12791287

1280-
[,shell]
1288+
[,clojure-repl]
12811289
----
12821290
user=> (reset)
12831291
:reloading (todo.routes)
@@ -1347,7 +1355,7 @@ combined with `execute!`.
13471355
We can reset via the REPL and add some test data with the `sql`
13481356
convenience function.
13491357

1350-
[,shell]
1358+
[,clojure-repl]
13511359
----
13521360
user=> (reset)
13531361
:reloading (todo.routes)
@@ -1965,6 +1973,7 @@ Once CIDER has connected, you can open a REPL with: kbd:[C-c] kbd:[C-z]
19651973
This works in a similar way to the command-line REPL. To start up Duct,
19661974
you can use the `(go)` command:
19671975

1976+
[,clojure]
19681977
----
19691978
user> (go)
19701979
----
@@ -2001,7 +2010,7 @@ print the expression, its value, and its location in your project.
20012010

20022011
For example, at the REPL:
20032012

2004-
[,clojure]
2013+
[,clojure-repl]
20052014
----
20062015
user=> (* 2 #p (+ 1 1))
20072016
#p[user/eval11138:1] (+ 1 1) => 2
@@ -2021,7 +2030,7 @@ possible to use Duct with Leiningen.
20212030
To do so, you'll need to update your project file with profile for Duct,
20222031
and an alias to run it:
20232032

2024-
.project
2033+
.project.clj
20252034
[,clojure]
20262035
----
20272036
(defproject org.example/app "0.1.0-SNAPSHOT"
@@ -2069,6 +2078,7 @@ TIP: Use kbd:[Ctrl-Shift-P] to open the command palette.
20692078
You'll be presented with a REPL where you can start the application
20702079
with `(go)`
20712080

2081+
[,clojure]
20722082
----
20732083
clj꞉user꞉> (go)
20742084
----

docs/reset.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
Josh's Custom CSS Reset
3+
https://www.joshwcomeau.com/css/custom-css-reset/
4+
*/
5+
6+
*, *::before, *::after {
7+
box-sizing: border-box;
8+
}
9+
10+
* {
11+
margin: 0;
12+
}
13+
14+
@media (prefers-reduced-motion: no-preference) {
15+
html {
16+
interpolate-size: allow-keywords;
17+
}
18+
}
19+
20+
body {
21+
line-height: 1.5;
22+
-webkit-font-smoothing: antialiased;
23+
}
24+
25+
img, picture, video, canvas, svg {
26+
display: block;
27+
max-width: 100%;
28+
}
29+
30+
input, button, textarea, select {
31+
font: inherit;
32+
}
33+
34+
p, h1, h2, h3, h4, h5, h6 {
35+
overflow-wrap: break-word;
36+
}
37+
38+
p {
39+
text-wrap: wrap;
40+
}
41+
h1, h2, h3, h4, h5, h6 {
42+
text-wrap: balance;
43+
}
44+
45+
#root, #__next {
46+
isolation: isolate;
47+
}

0 commit comments

Comments
 (0)