Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joelittlejohn/clj-wrap-indent
A Clojure library to wrap, indent and (if required) print paragraphs.
https://github.com/joelittlejohn/clj-wrap-indent
clojure command-line console indentation stdout
Last synced: 4 months ago
JSON representation
A Clojure library to wrap, indent and (if required) print paragraphs.
- Host: GitHub
- URL: https://github.com/joelittlejohn/clj-wrap-indent
- Owner: joelittlejohn
- License: epl-1.0
- Created: 2017-03-20T20:35:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-25T09:58:09.000Z (over 7 years ago)
- Last Synced: 2024-04-26T20:07:36.530Z (10 months ago)
- Topics: clojure, command-line, console, indentation, stdout
- Language: Clojure
- Size: 8.79 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clj-wrap-indent [![Build Status](https://travis-ci.org/joelittlejohn/clj-wrap-indent.png)](https://travis-ci.org/joelittlejohn/clj-wrap-indent)
[![clj-wrap-indent at Clojars](https://clojars.org/clj-wrap-indent/latest-version.svg)](https://clojars.org/clj-wrap-indent)
A Clojure library to wrap, indent and (if required) print paragraphs. Useful for neat docs in the console.
Supports single- or multi-line text as input.
## Usage
```clj
(ns myapp.core
(:require [clj-wrap-indent.core :as wrap]))
;; get a wrapped and indented string
(wrap/wrap-indent "Some text...")
(wrap/wrap-indent "Some text..." 80)
(wrap/wrap-indent "Some text..." 80 7);; print a wrapped and indented string to stdout
(wrap/println "Some text...")
(wrap/println "Some text..." 80)
(wrap/println "Some text..." 80 7)
```
```
;; example printlnuser=> (wrap/println "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.")
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book.user=> (wrap/println "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."
40 2)
Lorem Ipsum is simply dummy text of
the printing and typesetting industry.
Lorem Ipsum has been the industry's
standard dummy text ever since the
1500s, when an unknown printer took a
galley of type and scrambled it to
make a type specimen book.
```## License
Copyright © 2017 Joe Littlejohn
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.