3 releases

0.1.2 Apr 6, 2024
0.1.1 Apr 6, 2024
0.1.0 Mar 31, 2024

#338 in Text processing

Download history 21/week @ 2024-07-26 2/week @ 2024-08-02 27/week @ 2024-09-20 3/week @ 2024-09-27

70 downloads per month

MIT license

17KB
332 lines

Lorem-Ipsum-rs Generator

Quickly generate placeholder text using Rust

Installation

cargo install lorem-ipsum

Upgrading

cargo install --force lorem-ipsum

Usage

Usage: lorem-ipsum [OPTIONS] [WORDLIST]

Arguments:
  [WORDLIST]
          A path to a wordlist to use other than the default

Options:
  -t, --text-mode <TEXT_MODE>
          What kind of text to generate
          
          [default: paragraphs]

          Possible values:
          - words:      Generate a number of words specified by word-count
          - sentences:  Generate a number of sentences specified by sentence-count
          - paragraphs: Generate a number of paragraphs specified by paragraph-count

  -w, --words <WORDS_COUNT>
          Specify how many words in total / per sentence to generate
          
          [default: 7..15]

  -s, --sentences <SENTENCES_COUNT>
          Specify how many sentences into total / per paragraph to generate
          
          [default: 3..5]

  -p, --paragraphs <PARAGRAPHS_COUNT>
          Specify how many paragraphs to generate in total
          
          [default: 2]

  -c, --comma <COMMA_PROBABILITY>
          Specify about how many words to generate before placing a comma
          
          [default: 7]

  -f, --static-first-sentence
          Whether or not the first sentence / words should be the standard "Lorem ipsum..."

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Example usage

$ lorem-ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Cupidatat eu consectetur lorem irure reprehenderit nisi id velit et consequat. Aute dolor minim cupidatat tempor nulla sit in. Quis tempor, sit, eu aliquip ut fugiat est ullamco laboris irure exercitation aute.

Voluptate ullamco veniam elit ea aliquip sit. Ipsum eu dolor dolore, amet laborum qui nostrud, quis labore. Reprehenderit sit ex sint commodo dolore, pariatur qui est fugiat veniam velit laborum ea labore.

Or, to get a wrapped, we can use the GNU fold command:

$ lorem-ipsum | fold -w 80 -s
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor 
incididunt ut labore et dolore magna aliqua. Veniam culpa officia ipsum qui 
nisi labore ex eiusmod, dolor consequat. Amet consectetur tempor cillum duis 
incididunt mollit ex.

Ut sit labore do velit eu, lorem id in enim dolore ea eiusmod cupidatat irure. 
Deserunt eiusmod velit et qui veniam nostrud duis ea elit dolore ullamco 
adipiscing. Elit voluptate velit enim laborum, culpa duis.

Dependencies

~3.5–5MB
~91K SLoC