views:

1150

answers:

13

What would be a good offline alternative of the online Lipsum generator? It's frustrating when I'm not online and need some placeholder text for testing purpose. A CLI utility would be ideal, so that I can tailor the output to fit my needs.

+1  A: 

Not sure about a command line version but there is a firefox extension that does Lorem Ipsum: https://addons.mozilla.org/en-US/firefox/addon/2064

hacama
It gets the lipsum text from the same site I linked in my question
Imran
yea just saw that - see my other post for a homemade solution...
hacama
+5  A: 

Generate a long section online. Save it to a txt file. Refer to txt file when offline.

John Sheehan
Ya, how often does Lorem ipsum change that you need a generator anyway?
ProfK
Generators come in handy when you need it in specific number of characters, words, paragraphs and etc.
Brian Kim
+1  A: 

Word 2007 will produce a block of placeholder text when you type in =rand() and this hit the return/enter key. If you're looking for simple placeholder text, I'd go ahead and generate a bunch ahead of time and stick it in a text file.

Orion Adrian
+1  A: 

Django includes the {% lorem %} tag as part of the contrib addons. It shouldn't be too hard to make a command-line version. Here's the source.

Jim
+1  A: 

On http://www.lipsum.com there are links to several offline Lorem Ipsum generators, about halfway down the frontpage. Or you could write one of your own in a matter of minutes.

Edit: This isn't accurate, I wrongfully assumed all of the linked lorem ipsum generators were offline ones, not only the LaTeX one.

Hank
+8  A: 

In Office 2007 apps, you can type in

=lorem(n)

with n equaling the number of paragraphs of lorem ipsum you would like generated.

shadit
+4  A: 

If you have python available, google code has a CLI generator.

http://code.google.com/p/lorem/

Matt
+2  A: 

Textmate has a built in snippet to print this

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

From

lorem

Teifion
You need to press <tab> to generate the text.
Devin Reams
That is awesome. This is why I love TextMate.
Kyle Cronin
A: 

Just checked and found that it pulls text from the website so it wouldn't work online... sorry about that, how about this though:

#!/usr/bin/env python

import sys
import random

try:
    n = int(sys.argv[1])
except:
    print 'Usage: %s num-words' % sys.argv[0]

words = open('/usr/share/dict/words').readlines()
for i in range(n):
    print words[random.randrange(0, len(words))][:-1],
hacama
A: 

At the bottom of the lorem ipsum generator you will find links to the generator for other usage. My understanding is the following can be used offline:

But you may also find the following helpful:

  • WWW::Lipsum CPAN Module
  • Firefox Add-on
  • Dreamweaver Extension
  • GTK Lipsum
  • ActionScript3

Each of these, while requiring connectivity, reduce the load on the lipsum generator as they don't require loading the actual website.

Devin Reams
Thanks, but I really need a total offline solution. I did take a look at the Lipsum CPAN module before. It's rather nice, only if it worked offline...
Imran
A: 

If you are on linux and have these tools:

pdf2ps | ps2txt < yourarticlecollection/someresearchpaper.pdf

:)

Seiously, most of the time I just copy&paste from research papers and articles that interests me. They have good amount of text that show white rivers and sometimes as incomprehensible as "Lorem ipsum".

artificialidiot
The whole point of lorem ipsum is that it *isn't* comprehensible text, so that you concentrate on the design rather than what is being said.
Jim
+2  A: 

Django's lipsum addon seemed pretty straightforward. As I didn't want to install python just to run this script, I ported it to php.

Here's my PHP version:

http://pastebin.com/f7c58bbb9

Imran
A: 

Slightly off-topic: try to avoid using lorem ipsum for layout testing!

The letter frequencies in Latin are way different than in e.g. English or German. There's lots of 'i' and 'l', i.e. lots of narrow letters.

Jörg W Mittag