riot-placeholder

1.0.6 • Public • Published

riot-placeholder

build npm version codecov

NPM

Riot.js plugin for generating placeholder text.

About

riot-placeholder is a simple riot tag used for scaffolding and prototyping riot.js based websites and applications.

This tag was built with foobar-ipsum.

Examples

Usage

To install via NPM:

npm install riot-placeholder

For a quick start using jsdelivr:

<script src="https://cdn.jsdelivr.net/npm/riot-placeholder/dist/riot-placeholder.js"></script>

Once available, riot-placeholder can be used like so:

import riot from 'riot'
import placeholder from 'riot-placeholder'
 
placeholder(riot)
 
console.log(`John said "${riot.placeholder.word()}" I tell you!`)
<h1 data-is="ph"></h1>
<!-- override default unit (word, sentence, paragraph) -->
<!-- override default size (md) -->
<span data-is="ph" unit="sentence" size="lg"></span>
<p data-is="ph"></p>

The tag takes two configurable opts:

unit: Unit for generator to target.

By default, the tag will automatically determine the unit depending on the target node.

  • word: h1, h2, h3, h4, h5
  • sentence: span
  • paragraph: p

size: Size of the generated content (sm, md, lg).

Contributors

Contributing guidelines are as follows,

  • Any new features must include a unit test.
    • Branches for bugs and features should be structured like so, issue-x-username.
  • Before putting in a pull request, be sure to verify you've built all your changes.
  • Include your name and email in the contributors list.

Copyright (c) 2017 John Nolette Licensed under the MIT license.

Package Sidebar

Install

npm i riot-placeholder

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

18 kB

Total Files

14

Last publish

Collaborators

  • neetjn