Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/damianopetrungaro/nest
Nest is a simple writer which can nest the content to look nice and sorted :heart:
https://github.com/damianopetrungaro/nest
golang module nest writer
Last synced: 8 days ago
JSON representation
Nest is a simple writer which can nest the content to look nice and sorted :heart:
- Host: GitHub
- URL: https://github.com/damianopetrungaro/nest
- Owner: damianopetrungaro
- License: mit
- Created: 2020-11-22T16:23:41.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-26T23:05:18.000Z (about 4 years ago)
- Last Synced: 2024-11-11T15:47:20.476Z (2 months ago)
- Topics: golang, module, nest, writer
- Language: Go
- Homepage: https://pkg.go.dev/github.com/damianopetrungaro/nest
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nest
[![codecov](https://codecov.io/gh/damianopetrungaro/nest/branch/main/graph/badge.svg?token=FMSFGJNSEX)](https://codecov.io/gh/damianopetrungaro/nest)
Nest is a `io.Writer` implementation which allow you to nested content,
taking care of indenting the content and adding titles to each section.An example of an output is this
```
This is the start of the ordered list
1. Item one
1.1 Written item
2. Item two
2.1 Written item
2.1 Written item
3. Item three
3.1 Written item
This is the start of the unordered list
- Item one
- Item two
- Item three
```To interact with simplified APIs, but not compliant with the `io.Writer` there is a `SimpleWriter` which allows an even simpler usage.
### Examples
For the writer take a look at the `nest_example_test.go` file, for the simple writer take a look at the `simple_example_test.go` file