Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated formatting on Readme #13

Merged
merged 2 commits into from
Sep 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
[![npm](https://img.shields.io/npm/dt/ellipsed.svg)](https://www.npmjs.com/package/ellipsed)
[![npm](https://img.shields.io/npm/dw/ellipsed.svg)](https://www.npmjs.com/package/ellipsed)  
[![Demo](https://img.shields.io/badge/Demo-here-yellowgreen.svg)](https://nzambello.github.io/ellipsed/)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/nzambello/ellipsed/issues)


A JavaScript library for multilined ellipsis.
## What is Ellipsed?
Ellipsed is a JavaScript plugin for generating multi-lined ellipsed text. It provides the ability to specify the number of lines visible.

## Demo
You can see the example here: https://nzambello.github.io/ellipsed/
Expand All @@ -17,27 +18,30 @@ The [example/](https://github.com/nzambello/ellipsed/tree/master/example) direct
To start it on your local machine, clone the repository and install it by following the installation instructions below, then start it with `npm start` (or with `yarn start`).

## Install
Ellipsed is published via npm, so you can install it with:
```shell
```sh
# Yarn
yarn add ellipsed
```
or, if using npm:
```shell

# NPM
npm install --save ellipsed
```

It's published also via bower:
```shell

# Bower
bower install ellipsed
```

## Usage
Ellipsed provides a function that is used like this:
`ellipsis(selector, rows);`
````javascript
ellipsis(selector, rows);
````

`selector` is a CSS selector string and `rows` is the number of rows that should be visible.
Words that exceed the specified number of rows are truncated with `...` at the end.
### Settings
Option | Type | Description
------ | ---- | -----------
selector | string | CSS selector used to target the element
rows | int | Number of rows that should be visible, following words will be trucated with ...

### Import
Ellipsed is provided as a UMD module.

You can use it as a ES6 module:
Expand All @@ -61,5 +65,5 @@ Or as a global module in the browser:
var ellipsis = window.ellipsed.ellipsis;
```

## Contributing   [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/nzambello/ellipsed/issues)
New contributors are warmly welcome, see the [CONTRIBUTING.md](https://github.com/nzambello/ellipsed/blob/master/CONTRIBUTING.md) file for other infos.
## Contributing
New contributors are warmly welcome, see the [CONTRIBUTING.md](https://github.com/nzambello/ellipsed/blob/master/CONTRIBUTING.md) file for other information.