Skip to content

Commit 93f6c63

Browse files
committed
regenerate site
1 parent e238b90 commit 93f6c63

File tree

11 files changed

+126
-109
lines changed

11 files changed

+126
-109
lines changed

articles/cookbooks/cli_build_projects/index.html

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ <h2 id="toolsbuild-and-the-clojure-cli"><code>tools.build</code> and the Clojure
148148
:aliases
149149
{
150150
;; add this to :aliases in deps.edn:
151-
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.4"}}
151+
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.6"}}
152152
:ns-default build}
153153
}}
154154
</code></pre><p>The <code>-T</code> option implicitly sets <code>:paths ["."]</code> (as opposed to <code>:paths ["src"]</code>
@@ -183,7 +183,7 @@ <h2 id="toolsbuild-and-the-clojure-cli"><code>tools.build</code> and the Clojure
183183
:main-args ["-e" "(clojure-version)"]})]
184184
(b/process cmd)))
185185
</code></pre><p>We can run this with:</p><pre><code>clojure -T:build run
186-
</code></pre><p>and we'll see the version of Clojure we're running: <code>"1.11.4"</code>.</p><p><strong>Error Handling</strong></p><p>Since we will generally want the build to fail if the command exits with
186+
</code></pre><p>and we'll see the version of Clojure we're running, for example: <code>"1.12.0"</code>.</p><p><strong>Error Handling</strong></p><p>Since we will generally want the build to fail if the command exits with
187187
a non-zero status, we'll check the return value of <code>b/process</code> and throw
188188
an exception if the exit status is non-zero:</p><pre><code class="clojure"> (when-not (zero? (:exit (b/process cmd)))
189189
(throw (ex-info (str "run failed for " aliases) opts)))
@@ -243,11 +243,12 @@ <h2 id="toolsbuild-and-the-clojure-cli"><code>tools.build</code> and the Clojure
243243
new <code>test-multi</code> function in <code>build.clj</code>.</p><p>Add these aliases to <code>deps.edn</code>:</p><pre><code class="clojure"> :1.9 {:override-deps {org.clojure/clojure {:mvn/version "1.9.0"}}}
244244
:1.10 {:override-deps {org.clojure/clojure {:mvn/version "1.10.3"}}}
245245
:1.11 {:override-deps {org.clojure/clojure {:mvn/version "1.11.4"}}}
246+
:1.12 {:override-deps {org.clojure/clojure {:mvn/version "1.12.0"}}}
246247
</code></pre><p>When these aliases are used in combination with other aliases, the default
247248
version of Clojure will be overridden with the specified version. We can see
248249
this by running <code>clojure -T:build run :aliases '[:1.9]'</code> and seeing <code>"1.9.0"</code>
249250
for example.</p><p>Here's our <code>test-multi</code> function:</p><pre><code class="clojure">(defn test-multi [opts]
250-
(doseq [v [:1.9 :1.10 :1.11]]
251+
(doseq [v [:1.9 :1.10 :1.11 :1.12]]
251252
(println "\nTest with Clojure" v)
252253
(test (update opts :aliases conj v)))
253254
opts)
@@ -285,6 +286,16 @@ <h2 id="toolsbuild-and-the-clojure-cli"><code>tools.build</code> and the Clojure
285286
Testing example-test
286287
1.11.4
287288

289+
Ran 1 tests containing 1 assertions.
290+
0 failures, 0 errors.
291+
292+
Test with Clojure :1.12
293+
294+
Running tests in #{"test"}
295+
296+
Testing example-test
297+
1.12.0
298+
288299
Ran 1 tests containing 1 assertions.
289300
0 failures, 0 errors.
290301
</code></pre><h2 id="tips-for-building-jar-files">Tips for Building JAR Files</h2><p>Although the official <code>tools.build</code> has examples for
@@ -360,7 +371,7 @@ <h2 id="toolsbuild-and-the-clojure-cli"><code>tools.build</code> and the Clojure
360371
&lt;dependency&gt;
361372
&lt;groupId&gt;org.clojure&lt;/groupId&gt;
362373
&lt;artifactId&gt;clojure&lt;/artifactId&gt;
363-
&lt;version&gt;1.11.4&lt;/version&gt;
374+
&lt;version&gt;1.12.0&lt;/version&gt;
364375
&lt;/dependency&gt;
365376
&lt;/dependencies&gt;
366377
&lt;repositories&gt;

articles/cookbooks/date_and_time/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77

88
<meta name="description" content="This cookbook covers working with Java&#39;s java.time package in two styles, the
9-
first with interop and the second using libraries.This guide covers Clojure 1.11.4 and Java 8 or later.">
9+
first with interop and the second using libraries.This guide covers Clojure 1.12.0 and Java 8 or later.">
1010

1111
<meta property="og:description" content="This cookbook covers working with Java&#39;s java.time package in two styles, the
12-
first with interop and the second using libraries.This guide covers Clojure 1.11.4 and Java 8 or later.">
12+
first with interop and the second using libraries.This guide covers Clojure 1.12.0 and Java 8 or later.">
1313

1414
<meta property="og:url" content="https://clojure-doc.org/articles/cookbooks/date_and_time/" />
1515
<meta property="og:title" content="Date and Time" />
@@ -65,7 +65,7 @@ <h2>Date and Time</h2>
6565
</div>
6666

6767
<p>This cookbook covers working with Java's <code>java.time</code> package in two styles, the
68-
first with interop and the second using libraries.</p><p>This guide covers Clojure 1.11.4 and Java 8 or later.</p><p>This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution
68+
first with interop and the second using libraries.</p><p>This guide covers Clojure 1.12.0 and Java 8 or later.</p><p>This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution
6969
3.0 Unported License</a> (including images &amp; stylesheets). The source is
7070
available <a href="https://github.com/clojure-doc/clojure-doc.github.io">on Github</a>.</p><h1 id="introduction">Introduction</h1><p>This cookbook does not assume a background in Java, if you have such a
7171
background the interop section might be of interest.</p><p>This cookbook will be useful if you got your Clojure environment setup, know
@@ -75,7 +75,7 @@ <h2>Date and Time</h2>
7575
literal</a> is used
7676
to represent a <code>java.util.Date</code> object.</li></ul><p>While in JavaScript:
7777
TBD</p><h2 id="libraries">Libraries</h2><ul><li><a href="https://github.com/dm3/clojure.java-time">clojure.java-time</a><blockquote><p>A Clojure wrapper for Java 8 Date-Time API.</p></blockquote></li><li><a href="https://github.com/henryw374/cljc.java-time">cljc.java-time</a><blockquote><p>A Clojure(Script) library which mirrors the java.time api through kebab-case-named vars.</p></blockquote></li><li><a href="https://github.com/juxt/tick">tick</a><blockquote><p>A Clojure(Script) &amp; babashka library for dealing with time. Intended as a replacement for clj-time.</p></blockquote></li></ul><h1 id="preliminaries">Preliminaries</h1><p>The examples below assume the following <code>deps.edn</code></p><pre><code class="clojure">{:paths ["src"]
78-
:deps {org.clojure/clojure {:mvn/version "1.11.4"}
78+
:deps {org.clojure/clojure {:mvn/version "1.12.0"}
7979
clojure.java-time/clojure.java-time {:mvn/version "1.3.0"}
8080
com.widdindustries/cljc.java-time {:mvn/version "0.1.21"}}}
8181
</code></pre><h1 id="recipes">Recipes</h1><h2 id="clojurejava-time"><code>clojure.java-time</code></h2><h3 id="basics">Basics</h3><p>For the people coming from a non-Java background, we are creating an <em>instance</em>

articles/cookbooks/parsing_xml_with_zippers/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ <h2>Parsing XML in Clojure</h2>
8484
:url ""
8585
:license {:name "Eclipse Public License"
8686
:url "https://www.eclipse.org/legal/epl-v10.html"}
87-
:dependencies [[org.clojure/clojure "1.11.4"]
87+
:dependencies [[org.clojure/clojure "1.12.0"]
8888
[org.clojure/data.zip "1.0.0"]])
8989
</code></pre><p>We are including a dependency on
9090
<a href="https://github.com/clojure/data.zip">clojure.data.zip</a>, which is a

articles/ecosystem/libraries_authoring/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ <h2>Ecosystem: Library Development and Distribution</h2>
7878
see <code>clojure-example-library</code> in this guide! We will use <code>my-cool-lib</code>
7979
as the name of the new project we create and publish here, but you
8080
can use whatever name you want -- just remember to substitute that
81-
wherever you see <code>my-cool-lib</code> in this guide.</p><p>This guide uses Clojure 1.11 and a recent version of the Clojure CLI
82-
(at least 1.11.1.1139; current version is 1.11.4.1474 as of August 2024),
81+
wherever you see <code>my-cool-lib</code> in this guide.</p><p>This guide uses Clojure 1.12 and a recent version of the Clojure CLI
82+
(at least 1.12.0.1479; current version is 1.12.0.1488 as of December 2024),
8383
and requires you have <code>git</code>
8484
installed (though very little familiarity with <code>git</code> is required).</p><blockquote><p>Note: you should always ensure you have an up-to-date version of the Clojure CLI installed! See <a href="https://clojure.org/releases/tools">Tools Releases</a>. Several of the examples here require 1.11.1.1139 or later: <code>clojure -version</code> should tell you the version you have installed.</p></blockquote><p>It's assumed that you're already somewhat familiar with Clojure. If
8585
not, see the <a href="/articles/tutorials/getting_started/">Getting Started</a> and
@@ -217,7 +217,7 @@ <h2>Ecosystem: Library Development and Distribution</h2>
217217
</code></pre><h2 id="write-tests">Write Tests</h2><p>In <code>test/clojure_example_library/my_cool_lib_test.clj</code>, add tests as needed.
218218
An example is provided in there to get you started.</p><blockquote><p>Note: the example test created by <code>deps-new</code> fails deliberately in order
219219
for you to get accustomed to writing tests!</p></blockquote><h2 id="write-code">Write Code</h2><p>Write code to make your tests pass.</p><p>Remember to add a note at the top of each file indicating copyright
220-
(and the license under which the code is distributed, if applicable).</p><p>For example:</p><pre><code class="clojure">;; copyright (c) 2023 -- Sean Corfield, all rights reserved.
220+
(and the license under which the code is distributed, if applicable).</p><p>For example:</p><pre><code class="clojure">;; copyright (c) 2024 -- Sean Corfield, all rights reserved.
221221
</code></pre><h2 id="run-tests">Run Tests</h2><p>In your project dir:</p><pre><code>clojure -M:test -m cognitect.test-runner
222222
</code></pre><p>or:</p><pre><code>clojure -T:build test
223223
</code></pre><blockquote><p>Note: if you didn't use <code>deps-new</code> to create your library project, you'll want to add a <code>:test</code> alias that adds <a href="https://github.com/cognitect-labs/test-runner">Cognitect's <code>test-runner</code></a> to your project -- see <a href="https://github.com/cognitect-labs/test-runner#configuration"><strong>Configuration</strong></a> in that project's <code>README</code>. The <code>:test</code> alias <code>deps-new</code> generates does not have <code>:exec-fn</code> or <code>:main-opts</code> because it expects you to run tests via the <code>build.clj</code> file, although you can provide <code>-m cognitect.test-runner</code> on the command-line to run tests directly via the CLI, as shown above.</p></blockquote><h2 id="commit-any-remaining-changes">Commit any remaining changes</h2><p>Before continuing to the next step, make sure all tests pass and

articles/tutorials/basic_web_development/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ <h2>Basic Web Development</h2>
8080
<a href="/articles/tutorials/introduction/">Introduction</a> guides.</p><p>This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/3.0/">Creative Commons
8181
Attribution 3.0 Unported License</a> (including images &amp;
8282
stylesheets). The source is available <a href="https://github.com/clojure-doc/clojure-doc.github.io">on
83-
Github</a>.</p><p>This guide uses Clojure 1.11.4, as well as current versions of the
83+
Github</a>.</p><p>This guide uses Clojure 1.12.0, as well as current versions of the
8484
component libraries noted below.</p><h2 id="conceptual-overview-of-components">Conceptual Overview of Components</h2><p>We'll use four major components (briefly described below) for our
8585
little webapp:</p><ul><li>Ring</li><li>Compojure</li><li>Hiccup</li><li>H2</li></ul><h3 id="ring">Ring</h3><p><a href="https://github.com/ring-clojure/ring">Ring</a> (<a href="https://clojars.org/ring">at
8686
clojars</a>) is a foundational Clojure web
@@ -115,8 +115,8 @@ <h2>Basic Web Development</h2>
115115
file to specify the libraries we want to use, and a couple of folders: one
116116
for CSS files and one for your source code.</p><p>The <code>deps.edn</code> file should have the following contents:</p><pre><code class="clojure">{:paths ["src" "resources"]
117117
:deps {;; basic Ring and web server:
118-
ring/ring-core {:mvn/version "1.12.2"}
119-
ring/ring-jetty-adapter {:mvn/version "1.12.2"}
118+
ring/ring-core {:mvn/version "1.13.0"}
119+
ring/ring-jetty-adapter {:mvn/version "1.13.0"}
120120
;; logging, required by jetty:
121121
org.slf4j/slf4j-simple {:mvn/version "2.0.13"}
122122

@@ -236,7 +236,7 @@ <h2>Basic Web Development</h2>
236236
the value for that column.</p><p>You can try the code out in the <code>comment</code> form by evaluating each expression
237237
in it, and you should see the same results as the inline comments show.</p><p>You can also try those calls yourself in a standalone REPL,
238238
if you like:</p><pre><code class="clojure">clj
239-
Clojure 1.11.4
239+
Clojure 1.12.0
240240
user=&gt; (require 'my-webapp.db)
241241
nil
242242
;; you must require a namespace before you go into it:
@@ -400,12 +400,12 @@ <h2>Basic Web Development</h2>
400400
<a href="https://clojure.org/guides/tools_build"><code>tools.build</code> guide</a> for more details.</p><p>To make your webapp suitable for deployment, make the following
401401
changes:</p><h3 id="changes-in-depsedn">Changes in deps.edn</h3><p>In your <code>dep.edn</code> file add the following, after the <code>:deps</code> hash map:</p><pre><code class="clojure"> :aliases
402402
{;; Run with clj -T:build function-in-build
403-
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.4"}}
403+
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.6"}}
404404
:ns-default build}}
405405
</code></pre><p>The whole <code>deps.edn</code> file should now look like this:</p><pre><code class="clojure">{:paths ["src" "resources"]
406406
:deps {;; basic Ring and web server:
407-
ring/ring-core {:mvn/version "1.12.2"}
408-
ring/ring-jetty-adapter {:mvn/version "1.12.2"}
407+
ring/ring-core {:mvn/version "1.13.0"}
408+
ring/ring-jetty-adapter {:mvn/version "1.13.0"}
409409
;; logging, required by jetty:
410410
org.slf4j/slf4j-simple {:mvn/version "2.0.13"}
411411

@@ -423,7 +423,7 @@ <h2>Basic Web Development</h2>
423423
com.h2database/h2 {:mvn/version "2.2.224"}}
424424
:aliases
425425
{;; Run with clj -T:build function-in-build
426-
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.4"}}
426+
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.6"}}
427427
:ns-default build}}}
428428
</code></pre><h3 id="add-a-buildclj-file">Add a build.clj file</h3><p>The <code>tools.build</code> library is intended to be used with a <code>build.clj</code> script
429429
which typically lives in the root of your project and is invoked via the

articles/tutorials/editors/index.html

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@
66

77

88
<meta name="description" content="The last
9-
&quot;State of the Union&quot; Clojure survey (survey question 20) indicated
10-
that Emacs is still the most popular editing environment, followed by IntelliJ/Cursive, VS Code, and Vim.If you are already using one of these editors, follow one of the guides for that
9+
&quot;State of the Union&quot; Clojure survey indicated
10+
that Emacs is still the most popular editing environment (although it has
11+
fallen to just under 40%), followed by IntelliJ/Cursive and VS Code
12+
(equal at 23%), and then Vim (around 12.5%).If you are already using one of these editors, follow one of the guides for that
1113
editor to integrate a REPL-based Clojure workflow, so that you can focus on
1214
learning just the language.">
1315

1416
<meta property="og:description" content="The last
15-
&quot;State of the Union&quot; Clojure survey (survey question 20) indicated
16-
that Emacs is still the most popular editing environment, followed by IntelliJ/Cursive, VS Code, and Vim.If you are already using one of these editors, follow one of the guides for that
17+
&quot;State of the Union&quot; Clojure survey indicated
18+
that Emacs is still the most popular editing environment (although it has
19+
fallen to just under 40%), followed by IntelliJ/Cursive and VS Code
20+
(equal at 23%), and then Vim (around 12.5%).If you are already using one of these editors, follow one of the guides for that
1721
editor to integrate a REPL-based Clojure workflow, so that you can focus on
1822
learning just the language.">
1923

@@ -71,8 +75,10 @@ <h2>Clojure Editors</h2>
7175
</div>
7276

7377
<p>The last
74-
<a href="https://clojure.org/news/2023/06/30/state-of-clojure-2023">"State of the Union" Clojure survey</a> (survey question 20) indicated
75-
that Emacs is still the most popular editing environment, followed by IntelliJ/Cursive, VS Code, and Vim.</p><p>If you are already using one of these editors, follow one of the guides for that
78+
<a href="https://clojure.org/news/2024/12/02/state-of-clojure-2024">"State of the Union" Clojure survey</a> indicated
79+
that Emacs is still the most popular editing environment (although it has
80+
fallen to just under 40%), followed by IntelliJ/Cursive and VS Code
81+
(equal at 23%), and then Vim (around 12.5%).</p><p>If you are already using one of these editors, follow one of the guides for that
7682
editor to integrate a REPL-based Clojure workflow, so that you can focus on
7783
learning just the language.</p><p>If you are not using one of these four editors, try to pick the one that is
7884
closest to what you are currently using, unless your editor is listed on

articles/tutorials/getting_started/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ <h2>Getting Started</h2>
9898
repositories) without needing JAR files to be built and deployed.</p><p>Since the release of the official Clojure CLI, usage of Leiningen has dropped
9999
as the community adopted the new CLI and associated libraries such as
100100
<code>tools.deps</code> and <code>tools.build</code>.
101-
<em>[See <a href="https://clojure.org/news/2022/06/02/state-of-clojure-2022">State of Clojure 2022 Survey Results</a> -- and a year later the CLI usage exceeded 70% while Leiningen had dropped to around 60%]</em></p><p><strong>Too Much Information! What Should I Use?</strong></p><p>As noted above, if you're following a book or tutorial that uses Leiningen,
101+
<em>[See <a href="https://clojure.org/news/2024/12/02/state-of-clojure-2024">State of Clojure 2024 Survey Results</a> -- the CLI usage is just over 76% while Leiningen has dropped below 52%]</em></p><p><strong>Too Much Information! What Should I Use?</strong></p><p>As noted above, if you're following a book or tutorial that uses Leiningen,
102102
or working with a project that uses Leiningen, then keep using Leiningen.</p><p>If you're following a book or tutorial that uses the newer CLI, or working
103103
with a project that uses it, then keep using the Clojure CLI and associated
104104
libraries.</p><p>If you're starting from scratch, learning the Clojure CLI is probably a

articles/tutorials/getting_started_cli/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ <h2>Getting Started with the Clojure CLI</h2>
8080
see the list of all the options available.</p><h2 id="trying-out-the-repl">Trying out the REPL</h2><p>Once you have the Clojure CLI installed, you can run it from anywhere you like
8181
to get a REPL:</p><pre><code>$ clj
8282
</code></pre><p>You should be greeted with the Clojure version and a "<code>user=&gt;</code>" prompt. Try it out:</p><pre><code class="clojure">$ clj
83-
Clojure 1.11.4
83+
Clojure 1.12.0
8484
user=&gt; (+ 1 1)
8585
;; ⇒ 2
8686
user=&gt; (distinct [:a :b :a :c :a :d])
@@ -109,10 +109,10 @@ <h2>Getting Started with the Clojure CLI</h2>
109109
<code>clojure.main</code> can also evaluate expressions:</p><pre><code>$ clojure -M -e '(println "Hello, Command!")'
110110
Hello, Command!
111111
</code></pre><p>or:</p><pre><code>$ clojure -M -e '(clojure-version)'
112-
"1.11.4"
112+
"1.12.0"
113113
</code></pre><p>The <code>-e</code> option prints the value returned by the expression (if it is not <code>nil</code>).</p><blockquote><p>Note: you can find more detailed information about <a href="https://clojure-doc.org/articles/ecosystem/libraries_authoring/#creating-new-projects">Creating New Projects</a> later in this guide.</p></blockquote><h3 id="working-in-the-repl">Working in the REPL</h3><p>In your project directory, start up a repl (<code>clj</code>) and
114114
run your <code>-main</code> function to see its output in the repl:</p><pre><code>$ clj
115-
Clojure 1.11.4
115+
Clojure 1.12.0
116116
user=&gt; (require 'my.proj)
117117
nil
118118
user=&gt; (my.proj/-main)

0 commit comments

Comments
 (0)