Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pedrorgirardi/literate-example
https://github.com/pedrorgirardi/literate-example
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pedrorgirardi/literate-example
- Owner: pedrorgirardi
- License: apache-2.0
- Created: 2021-01-12T05:36:22.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-20T06:33:22.000Z (over 3 years ago)
- Last Synced: 2024-05-01T13:26:05.698Z (9 months ago)
- Language: Clojure
- Size: 18.6 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example Project for Literate
## Guide
* Clone the repository:
```
git clone https://github.com/pedrorgirardi/literate-example
```* Start a REPL (e.g. socket REPL):
```
clj -J"-Dclojure.server.repl={:port,7890,:accept,clojure.core.server/repl}"
```* Open the file `src/dev/clojure/user.clj` in your editor of choice.
* Connect to the appropriate REPL endpoint (for the example invocation above, it is port 7890 on the local machine).
* Evaluate the first `ns` form:
```clojure
(ns user
(:require [literate.server :as server]
[literate.client.core :as literate][clojure.java.io :as io]
[clojure.data.json :as json]))
```* Evaluate the first form within the `comment` block to start the server:
```clojure
(def stop-server (server/run-server {:port 8118}))
```* Open a web browser and navigate to "localhost:8118". You should see the word "Literate" in the browser window.
* Evaluate the second from within the `comment` block to prepare a convenience function for the rest of the example:
```clojure
(def l (partial literate/view {:url "http://localhost:8118"}))
```* Evaluate each of the remaining forms while observing the results in the web browser.
* Have fun :)