All Projects → bbrks → wrap

bbrks / wrap

Licence: MIT license
📖⏎ An efficient and flexible word-wrapping package for Go (golang)

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to wrap

Criterion
Microbenchmarking for Modern C++
Stars: ✭ 140 (+900%)
Mutual labels:  mit
Ninfs
FUSE filesystem Python scripts for Nintendo console files
Stars: ✭ 241 (+1621.43%)
Mutual labels:  mit
Bonmot
Beautiful, easy attributed strings in Swift
Stars: ✭ 3,182 (+22628.57%)
Mutual labels:  text-formatting
Zou
A simple and fast download accelerator, written in Rust
Stars: ✭ 145 (+935.71%)
Mutual labels:  mit
Prettyconf
A extensible library for Settings/Code separation
Stars: ✭ 173 (+1135.71%)
Mutual labels:  mit
Node
Node.js JavaScript runtime ✨🐢🚀✨
Stars: ✭ 83,731 (+597978.57%)
Mutual labels:  mit
Node Lifx
Node.js implementation of the LIFX LAN protocol 💡
Stars: ✭ 137 (+878.57%)
Mutual labels:  mit
loopback-component-mq
Loopback Component for working with a Message Queue
Stars: ✭ 19 (+35.71%)
Mutual labels:  mit
Panel
Pterodactyl is an open-source game server management panel built with PHP 7, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
Stars: ✭ 2,988 (+21242.86%)
Mutual labels:  mit
table-layout
Styleable plain-text table generator. Useful for formatting console output.
Stars: ✭ 18 (+28.57%)
Mutual labels:  text-formatting
Ifvisible.js
Crossbrowser & lightweight way to check if user is looking at the page or interacting with it.
Stars: ✭ 1,896 (+13442.86%)
Mutual labels:  mit
Crypto Notepad
🔑 Simple notepad for Windows with encryption features
Stars: ✭ 160 (+1042.86%)
Mutual labels:  mit
strf
Yet another C++ text formatting library.
Stars: ✭ 57 (+307.14%)
Mutual labels:  text-formatting
18s191
Course 18.S191 at MIT, Spring 2021 - Introduction to computational thinking with Julia:
Stars: ✭ 2,094 (+14857.14%)
Mutual labels:  mit
Text Mask
Input mask for React, Angular, Ember, Vue, & plain JavaScript
Stars: ✭ 8,102 (+57771.43%)
Mutual labels:  text-formatting
Mklicense
CLI tool for generating Licenses. Easily.
Stars: ✭ 137 (+878.57%)
Mutual labels:  mit
Networklayerexample
Demo project for the article: http://szulctomasz.com/how-do-I-build-a-network-layer/ (Swift 3)
Stars: ✭ 250 (+1685.71%)
Mutual labels:  mit
Entia
Entia is a free, open-source, data-oriented, highly performant, parallelizable and extensible Entity-Component-System (ECS) framework written in C# especially for game development.
Stars: ✭ 28 (+100%)
Mutual labels:  mit
Swiftrichstring
👩‍🎨 Elegant Attributed String composition in Swift sauce
Stars: ✭ 2,744 (+19500%)
Mutual labels:  text-formatting
react-text-mask-hoc
A higher-order text-mask component decorator for React and React Native.
Stars: ✭ 18 (+28.57%)
Mutual labels:  text-formatting

wrap Go Reference GitHub tag license Go Report Card codecov

An efficient and flexible word-wrapping package for Go (golang)

Usage

var loremIpsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vulputate quam nibh, et faucibus enim gravida vel. Integer bibendum lectus et erat semper fermentum quis a risus. Fusce dignissim tempus metus non pretium. Nunc sagittis magna nec purus porttitor mollis. Pellentesque feugiat quam eget laoreet aliquet. Donec gravida congue massa, et sollicitudin turpis lacinia a. Fusce non tortor magna. Cras vel finibus tellus."

// Wrap when lines exceed 80 chars.
fmt.Println(wrap.Wrap(loremIpsum, 80))
// Output:
// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vulputate quam
// nibh, et faucibus enim gravida vel. Integer bibendum lectus et erat semper
// fermentum quis a risus. Fusce dignissim tempus metus non pretium. Nunc sagittis
// magna nec purus porttitor mollis. Pellentesque feugiat quam eget laoreet
// aliquet. Donec gravida congue massa, et sollicitudin turpis lacinia a. Fusce non
// tortor magna. Cras vel finibus tellus.
var loremIpsum = "/* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vulputate quam nibh, et faucibus enim gravida vel. Integer bibendum lectus et erat semper fermentum quis a risus. Fusce dignissim tempus metus non pretium. Nunc sagittis magna nec purus porttitor mollis. Pellentesque feugiat quam eget laoreet aliquet. Donec gravida congue massa, et sollicitudin turpis lacinia a. Fusce non tortor magna. Cras vel finibus tellus. */"

w := wrap.NewWrapper()

// Trim the single-line block comment symbols from each input line.
w.TrimInputPrefix = "/* "
w.TrimInputSuffix = " */"

// Prefix each new line with a single-line comment symbol.
w.OutputLinePrefix = "// "

// Wrap when lines exceed 80 chars.
fmt.Println(w.Wrap(loremIpsum, 80))
// Output:
// // Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vulputate quam
// // nibh, et faucibus enim gravida vel. Integer bibendum lectus et erat semper
// // fermentum quis a risus. Fusce dignissim tempus metus non pretium. Nunc
// // sagittis magna nec purus porttitor mollis. Pellentesque feugiat quam eget
// // laoreet aliquet. Donec gravida congue massa, et sollicitudin turpis lacinia
// // a. Fusce non tortor magna. Cras vel finibus tellus.

Advanced Usage and more examples (custom breakpoints, prefixes, suffixes, etc.)

See godoc.org/github.com/bbrks/wrap for more examples using the Wrapper type to provide custom breakpoints, prefixes, suffixes, etc.

Contributing

Issues, feature requests or improvements welcome!

License

This project is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].