Skip to content

A script to automatically insert dummy text in the specified elements.

Notifications You must be signed in to change notification settings

shreyasminocha/Dummy.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dummy.js

A simple script for injecting dummy text into html pages.

Screenshot of Dummy.js in action

Getting Started

<head>
    <script src="/path/to/dummy.min.js"></script>
</head>

<body>
    <h1 data-dummy="5 words"></h1>
    <p data-dummy="6 sentences"></p>
    <!-- Both `1 paragraph` and `1 paragraphs` will work -->
    <p data-dummy="1 paragraph"></p>
</body>

There! Dummy.js is at your service.

CDN

https://cdn.jsdelivr.net/gh/shreyasminocha/Dummy.js@[insert version number]/dist/dummy.min.js

Make sure to replace [insert version number] with the tag of the latest version.

Usage

Words

The following snippet would fill <h1> with 5 words of dummy text.

<h1 data-dummy="5 words"></h1>

Sentences

The following snippet would fill <p> with 8 sentences of dummy text.

<p data-dummy="8 sentences"></p>

Paragraphs

The following snippet would fill <p> with 3 paragraphs of dummy text.

<p data-dummy="3 paragraphs"></p>

Ready to ditch pseudo-Latin?

You can temporarily disable Dummy.js, by simply commenting out the script tag that imports it. Once you have your copy ready, you could use the regular expressiondata-dummy=([\"\'])[\d\w ]*\1 to match all data-dummy attributes(and remove them).

License

MIT License

About

A script to automatically insert dummy text in the specified elements.

Topics

Resources

Stars

Watchers

Forks