lorem is a Go utility library for generating Lorem Ipsum text.
- - Build library code
- - Customize how many words per sentence
- - Customize how many sentences per paragraph
- - Customize the chance of a comma being added to a sentence
- - Build simple CLI
- - Build Neovim Plugin
- - Bootstrap binary for Neovim Plugin
- - Create ':LoremIpsum' command w/ args
- - Tab completion between words and paragraphs
- - Integrate with completion engine
- - Write out unit tests for library
- - Write out tests for Generator
- - Write out tests for CLI
- - Write out tests for Neovim Plugin
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.
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 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
Make sure you have the binary from the Latest Releases in your PATH, then:
Installing the plugin via Lazy:
{
"derektata/lorem",
config = function()
require("lorem")
end
},
Usage in Editor:
:LoremIpsum 5 <tab>
MIT License