offer-viewer

0.1.3 • Public • Published

Open Permissions Platform Offer Viewer

This library is responsible for displaying an ODRL offer in human-readable form.

Install

Include it in your package.json file, and run npm install.

Standalone Build

A standalone script is in the "dist" directory, which creates a OfferViewer global when the script is included in a web page. To build the standalone version run npm run build or npm run build:min for the minified version.

Usage

The Offer viewer uses elements of Bootstrap css and its default theme. Visit the Bootstrap website for instructions on how to use.

Offer Viewer with default element tag

var OfferViewer = require('offer-viewer');
var offer = <json-ld offer>
new OfferViewer(offer);
<html>
    <body>
        <offer></offer>
    </body>
</html>

Offer Viewer with custom element tag

var OfferViewer = require('offer-viewer');
var offer = <json-ld offer>
new OfferViewer(offer, tag='my-tag');
<html>
    <body>
        <my-tag></my-tag>
    </body>
</html>

See the examples directory for sample usage.

Readme

Keywords

none

Package Sidebar

Install

npm i offer-viewer

Weekly Downloads

4

Version

0.1.3

License

none

Last publish

Collaborators

  • openpermissions