Skip to content

Commit

Permalink
Merge pull request #184 from whatacold/get-started-demo-file
Browse files Browse the repository at this point in the history
use demo.clj instead of slides.clj for getting started demo.
  • Loading branch information
daslu authored Nov 12, 2024
2 parents 39ba780 + e179b6e commit 3bd034d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
21 changes: 21 additions & 0 deletions notebooks/demo.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(ns demo)

;; This file merely shows how to use a Clojure file to write docs in Clay,
;; with no additional dependencies required.

;; # This Is a H1 Title
;; ## And a H2 Title
;; Here, we can write comments in [Markdown](https://en.wikipedia.org/wiki/Markdown) format,
;; and normal Clojure code along the side,
;; both of which and the evaluated results of the code will show up in the redendered docs.

;; Below are a few simple examples:

(+ 1 2)

(str "Hello, " "Clay!")

(defn greet [name]
(str "Hello, " name "!"))

(greet "Clay")
8 changes: 4 additions & 4 deletions notebooks/index.clj
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@

;; At some point, you might find that you'd better write code in a .clj file.
;; No problem, Clay can also render a document from a Clojure file.
;; Here, we take [notebooks/slides.clj](https://raw.githubusercontent.com/scicloj/clay/refs/heads/main/notebooks/slides.clj) as an example.
;; Save the file to your computer as, say `/tmp/slides.clj`.
;; To render this Clojure namespace (or file if you prefer), you may run the following in the REPL:
;; Here, we take [notebooks/demo.clj](https://raw.githubusercontent.com/scicloj/clay/refs/heads/main/notebooks/demo.clj) as an example.
;; Click the link and save the file to your computer as, say, `/tmp/demo.clj`,
;; then you can render this Clojure namespace (or file if you prefer) by typing the following in the REPL:
;; ```clj
;; (clay/make! {:source-path "/tmp/slides.clj"})
;; (clay/make! {:source-path "/tmp/demo.clj"})
;; ```

;;
Expand Down

0 comments on commit 3bd034d

Please sign in to comment.