0.0.0 • Published 10 years ago

englipsum v0.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

Englipsum

See http://hardmath123.github.io/englipsum

The accepted Lorem Ipsum text is inherently messy. It has different character ratios and prevalent digraphs. The words are foreign to most of us, so they attract attention. There's barely any interesting formatting, because Cicero didn't have hyperlinks.

Englipsum solves those problems.

It generates grammatically-valid English that makes sense in context. It looks right, thus allowing itself to be ignored. Englipsum pays attention to the little details that make text natural-looking. The default dictionary includes words found on most tech-ey websites.

Usage

Simply include englipsum.js in your HTML file:

<script src="https://github.com/Hardmath123/englipsum/raw/gh-pages/englipsum.js></script>

Elements of class englipsum will be populated with placeholder text automatically.

<div class="englipsum"></div>

You can customize settings by including JSON in the element:

<div class="englipsum">
{
    "paragraphs": 3,
    "links": true
}
</div>

Reference

PropertyValue
paragraphsThe number of paragraphs to generate
sentencesThe number of sentences per paragraph
linksGenerate random links? (they are uniquely stamped so that testing a:visited is easy)
emsItalicize random words?
dictProvide your own dictionary. Object with fields (all optional) nouns, verbs, adjs, advs
dictReference a provided dictionary. Possible values: "farm"

Examples

Create a to-do list:

<ol>
    <li class="englipsum"> {"sentences": 1, "paragraphs": 1}</li>
    <li class="englipsum"> {"sentences": 1, "paragraphs": 1}</li>
    <li class="englipsum"> {"sentences": 1, "paragraphs": 1}</li>
    <li class="englipsum"> {"sentences": 1, "paragraphs": 1}</li>
</ol>

Placeholder text about animals:

<div class="englipsum">
{
    "dict": {
        "nouns": ["cow", "pig", "sheep", "fish", "farmer", "tractor"],
        "verbs": ["makes", "grows", "works", "produces", "helps"]
    }
}
</div>