https://github.com/derektata/lorem
Go utility library for generating Lorem Ipsum text
https://github.com/derektata/lorem
cli command-line-interface generator golang lorem-ipsum neovim-plugin utility-library
Last synced: 6 months ago
JSON representation
Go utility library for generating Lorem Ipsum text
- Host: GitHub
- URL: https://github.com/derektata/lorem
- Owner: derektata
- License: mit
- Created: 2023-07-15T01:29:18.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-02T01:25:31.000Z (almost 2 years ago)
- Last Synced: 2025-10-30T12:51:27.505Z (8 months ago)
- Topics: cli, command-line-interface, generator, golang, lorem-ipsum, neovim-plugin, utility-library
- Language: Go
- Homepage:
- Size: 649 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lorem
lorem is a Go utility library for generating Lorem Ipsum text.
## Todo List
- [X] - Build library code
- [X] - Customize how many words per sentence
- [X] - Customize how many sentences per paragraph
- [X] - Customize the chance of a comma being added to a sentence
- [X] - Build simple CLI
- [ ] - Build Neovim Plugin
- [ ] - Bootstrap binary for Neovim Plugin
- [X] - Create ':LoremIpsum' command w/ args
- [X] - Tab completion between words and paragraphs
- [ ] - Integrate with completion engine
- [ ] - Write out unit tests for library
- [X] - Write out tests for Generator
- [X] - Write out tests for CLI
- [ ] - Write out tests for Neovim Plugin
## Installation
To install the library, run the following command:
```
go get -u github.com/derektata/lorem
```
If you would like the CLI, grab the latest release from the [Latest Releases][Latest Release].
## Usage as a library
```go
package main
import (
lorem "github.com/derektata/lorem/ipsum"
)
func main() {
// Create a new generator
g := lorem.NewGenerator()
g.WordsPerSentence = 10 // Customize how many words per sentence
g.SentencesPerParagraph = 5 // Customize how many sentences per paragraph
g.CommaAddChance = 3 // Customize the chance of a comma being added to a sentence
// Generate words
words := g.Generate(100)
fmt.Println(words)
// Generate paragraphs
paragraphs := g.GenerateParagraphs(3)
fmt.Println(paragraphs)
}
```
## Usage as a CLI
```bash
Usage of lorem:
-p, --paragraphs int number of paragraphs to generate
-w, --words int number of words to generate (default 100)
Examples:
$ lorem -p 5
$ lorem -w 500
```
## Usage as a Neovim Plugin
Make sure you have the binary from the [Latest Releases][Latest Release] in your PATH, then:
Installing the plugin via Lazy:
```lua
{
"derektata/lorem",
config = function()
require("lorem")
end
},
```
Usage in Editor:
```
:LoremIpsum 5
```


## License
MIT License
[Latest Release]: https://github.com/derektata/lorem/releases