https://github.com/torvaney/reprex-clj
Reproducible examples for clojure
https://github.com/torvaney/reprex-clj
clojure reprex
Last synced: 10 months ago
JSON representation
Reproducible examples for clojure
- Host: GitHub
- URL: https://github.com/torvaney/reprex-clj
- Owner: Torvaney
- License: mit
- Created: 2018-09-01T16:11:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-03T20:49:09.000Z (almost 8 years ago)
- Last Synced: 2025-02-28T22:24:22.838Z (over 1 year ago)
- Topics: clojure, reprex
- Language: Clojure
- Size: 16.6 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# reprex
[](https://travis-ci.org/Torvaney/reprex-clj)
[](https://codecov.io/github/Torvaney/reprex-clj?branch=master)
[](https://clojars.org/reprex)
Prepare **repr**oducible **ex**ample (reprexes) for posting to [GitHub
issues](https://guides.github.com/features/issues/),
[StackOverflow](https://stackoverflow.com/questions/tagged/clojure), or [Slack
snippets](https://get.slack.help/hc/en-us/articles/204145658-Create-a-snippet).
This is a clojure port of the `tidyverse/reprex` [package for R](https://github.com/tidyverse/reprex).
# Usage
Use the `reprex` function to easily capture expressions and their outputs.
With no arguments, reprex will read code from the clipboard:
~~~
user=> (require '[reprex.core :refer [reprex]])
nil
user=> (println (reprex))
``` clojure
(+ 1 1)
; => 2
(* 5 5)
; => 25
```
Session info
```
Clojure version:
1.8.0
Java version:
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
```
Created by [reprex](https://github.com/Torvaney/reprex-clj)
nil
user=>
~~~
Alternatively, you can supply expressions as arguments:
```
user=> (->> (reprex (+ 1 1) (* 5 5)) println)
```
This GitHub-flavored Markdown is then ready to be copied and pasted. When
rendered, it looks like this:
``` clojure
(+ 1 1)
; => 2
(* 5 5)
; => 25
```
Session info
```
Clojure version:
1.8.0
Java version:
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
```
Created by [reprex](https://github.com/Torvaney/reprex-clj)