https://github.com/floraison/djan
Pretty printing for floraison and flor
https://github.com/floraison/djan
Last synced: 4 months ago
JSON representation
Pretty printing for floraison and flor
- Host: GitHub
- URL: https://github.com/floraison/djan
- Owner: floraison
- License: mit
- Created: 2024-12-17T01:43:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-24T23:56:29.000Z (7 months ago)
- Last Synced: 2025-11-28T10:27:18.179Z (6 months ago)
- Language: Ruby
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# djan
[](https://github.com/floraison/fugit/actions)
[](https://badge.fury.io/rb/djan)
Pretty pretting for floraison and flor. A bit loose like JS and YAML.
Meant for readable output, not for input.
```ruby
require 'djan'
Djan.to_dnc("papa tango charly") # -->
"\"papa tango charly\""
Djan.to_dnc({:a=>"abc"}) # -->
"{ a: abc }"
Djan.to_dnc([1, 2, "three"]) # -->
"[ 1, 2, three ]"
```
## options
```ruby
Djan.to_d(x, width: 40)
# set max width to 40 chars
Djan.to_d(x, width: :console)
Djan.to_d(x, width: true)
# use console width
Djan.to_d(x, color: false)
Djan.to_d(x, colour: false)
Djan.to_d(x, colors: false)
Djan.to_d(x, colours: false)
Djan.to_dnc(x)
# output without colours
```
## LICENSE
MIT, see [LICENSE.txt](LICENSE.txt)