Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/plugfox/multiline
Provides convenient access to multiline String records with method extensions.
https://github.com/plugfox/multiline
coverage multiline pipeline symbols wtfpl
Last synced: 3 months ago
JSON representation
Provides convenient access to multiline String records with method extensions.
- Host: GitHub
- URL: https://github.com/plugfox/multiline
- Owner: PlugFox
- License: wtfpl
- Created: 2020-04-24T22:13:38.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-18T19:20:02.000Z (over 2 years ago)
- Last Synced: 2023-08-20T22:34:55.123Z (over 1 year ago)
- Topics: coverage, multiline, pipeline, symbols, wtfpl
- Language: Dart
- Homepage: https://pub.dev/packages/multiline
- Size: 248 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# multiline
![](https://github.com/PlugFox/multiline/raw/master/.img/logo.png)
[![Actions Status](https://github.com/PlugFox/multiline/workflows/multiline/badge.svg)](https://github.com/PlugFox/multiline/actions)
[![Coverage](https://codecov.io/gh/PlugFox/multiline/branch/master/graph/badge.svg)](https://codecov.io/gh/PlugFox/multiline)
[![Pub](https://img.shields.io/pub/v/multiline.svg)](https://pub.dev/packages/multiline)
[![Code size](https://img.shields.io/github/languages/code-size/plugfox/multiline?logo=github&logoColor=white)](https://github.com/plugfox/multiline)
[![License: WTFPL](https://img.shields.io/badge/License-WTFPL-brightgreen.svg)](https://en.wikipedia.org/wiki/WTFPL)
[![effective_dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
[![GitHub stars](https://img.shields.io/github/stars/PlugFox/multiline?style=social)](https://github.com/PlugFox/multiline/)
## About
Provides convenient access to multiline String records with method extensions.
Useful for templates, mockups and SQL queries.
Just use the symbol "`|`" to indicate the beginning of a line.
Beautiful code formatting using some useful extensions to the String methods.
Available method extensions:
+ `multiline()` - return formatted with pipeline symbol "`|`" `String`.
+ `multilineSplit()` - splits the string and returns a `Iterable` of substrings.
You can use custom "pipeline" and "join" symbols.
## For example
```dart
import 'package:multiline/multiline.dart'; // <= import packagevoid main() {
/// Return formatted with pipeline symbol "`|`" [String].
final string =
'''
|/*
| * List of books and the number of
| * authors associated with each book
| */
|SELECT
| `books`.`title` AS `Title`,
| count(*) AS `Authors`
|FROM `books`
|JOIN `authors`
| ON `books`.`isbn` = `authors`.`isbn`
|GROUP BY
| `books`.`title`
|ORDER BY
| `books`.`title` ASC
|;
'''.multiline();
print(string);/// Splits the string and returns a [Iterable] of substrings.
final iterable =
'''
| * One
| * Two
| * Three
'''.multilineSplit();
iterable.forEach(print);
}
```
## Coverage
[![](https://codecov.io/gh/PlugFox/multiline/branch/master/graphs/sunburst.svg)](https://codecov.io/gh/PlugFox/multiline/branch/master)
## Changelog
Refer to the [Changelog](https://github.com/plugfox/multiline/blob/master/CHANGELOG.md) to get all release notes.
## Maintainers
[Plague Fox](https://plugfox.dev)
## License
[WTFPL](https://github.com/plugfox/multiline/blob/master/LICENSE)