Remove reference to GitHub from readme
refactor into class
fix test script after renamed main script
Placeholder text is typically drawn from the classic typographer’s text starting with “Lorem ipsum dolor sit amet”. One of the advantages of this text is that it contains all the letters of the basic Roman alphabet but does not consist of sentences in any natural language—allowing the appearance of the text to be examined without getting distracted by the content.
A disadvantage, however, is that automatic hyphenation doesn’t work, making it difficult to judge things like alignment and evenness of justified text.
This program generates a paragraph of text (of arbitrary length) by concatenating random lines from a text file of poetry. It does some basic parsing and punctuation fixes, but does currently produce the occasional miscapitalization of proper nouns (incl. of the first person singular pronoun I).
Basic usage:
./lipsum.py -n 5 poems.txt
The program is contained in a single self-explanatory Python script,
lipsum.py
. Run lipsum.py -h
for the usage message.
A demo bash script (demo.sh
) is also included, which will download two
poetry collections from Project Gutenberg,
patch them to remove the metadata, copyright notice, and poems in
dialogue format (which could be tricky to parse into natural sentences).
It then produces a markdown file and converts it to PDF. This last step
requires John MacFarlane’s excellent document conversion program
pandoc
. If you aren’t already
using it, I highly recommend you check it out.
What! could not Pluto spare the chief once more, restless and worn, and stern and wearisome, and many dream withal the hour is nigh nor here War’s clarion, but Love’s rebeck sounds; and shrieks the wild sea-mew. Dungeons and thrones, which the same hour refilled, with thy unquenched beam, lost Liberty! The wild Albanian kirtled to his knee.
But one small knot-grass growing by the pool and all the trouble of her labouring ships, as he went up and down; who made the world and ruleth it, He hangeth on a stalk, brown Dermot treads upon the lawn, shy one, shy one, the birds, for he opened their cages.
See what I did there?
yeats.txt
and byron.txt
in
this repo)pandoc
– for running the demo
onlypdflatex
– for running the demo onlyNote that the demo script is straightforward to modify such that pandoc
and pdflatex
are not required: Just replace the conversion block with
a call to plain markdown
to generate HTML, or remove it and just use the plain text output.
No installation required—just run the lipsum.py
script.
Download it directly or clone this repository.