Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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:

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