Giter Site home page Giter Site logo

simpsum's Introduction

Simpsum - Simple Lorem Ipsum

Simpsum makes it easy to add reusable placeholder text to your development websites.

This project was created as a way of adding placeholder text to be added to development sites in a consistent fashion. It also aims to solve the problem of forgetting to remove or change placeholder text before deployment by allowing developers to easily find and replace the consistent tags.

Installation

Download via bower.

bower install simpsum

Include the script on your web page.

<script src="simpsum.js"></script>

Next, call the script. A sample JSON file has been included in the examples folder.

<script>
  var simpsum = new Simpsum("path_to_dummy_content.json");
</script>

Note: If using a local .json file, it will need to be served via a local web server.

Usage

To set a placeholder section in your website, create a text element and include the {{ simpsum }} tag.

<h1>{{ simpsum }}</h1>
<p>{{ simpsum }}</p>

You can also force your placeholders to have a maximum length. The example below will limit the placeholder to 20 characters.

<p>{{ simpsum(20) }}</p>

Maximum lengths can also be specified as being of a range for when you want more variance in your selected content (e.g., when simulating user supplied content)

<p>{{ simpsum(20,30) }}</p>

You can use variable tag names by specifying the desired tag in the second parameter when calling the class:

<script>
  var simpsum = new Simpsum("path_to_dummy_content.json", "text");
</script>

And the tags can be called like so (in the same fashion as described above):

<p>{{ text }}</p>
<p>{{ text(10) }}</p>
<p>{{ text(10,20) }}</p>

simpsum's People

Contributors

dinglidingli avatar ciscoo avatar jolyonruss avatar

Stargazers

Colin Mather avatar Christian Carlsson avatar Bernardo avatar greg elwood avatar Gian Marco Toso avatar Duy Tran avatar Boris Cherny avatar Andrew Page avatar Rubén Reyes avatar Ali Stump avatar Tyler J Wilkinson avatar Abdullah Norozi Iranzad avatar Gianmarco avatar Nik Treiber avatar Johan Linder avatar Mark Luetke avatar Iain Matchett avatar

Watchers

 avatar

Forkers

jolyonruss

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.