New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rubricate

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rubricate

Clean way to build content via custom blocks.

  • 0.0.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Rubricate it's javascript library inspired by Stream (Wagtail), Paragraphs (Drupal), inlines (Django).

Usage

Contents:

  • Events
  • Plugins

Classes:

Extensions

Installation

Add rubricate.js to html template. Create new instance of rubricate:

let appHtmlElement = document.getElementById('#element-id');
let app = Rubricate(appHtmlElement);

Options

You also can pass options object passed to every plugin constructor.

defaultData — json object used to display data and plugins by default. Must have a structure similar to the stream.getData() method returns.

let appHtmlElement = document.getElementById('#element-id');
let stream = Rubricate(appHtmlElement, {
    defaultData: {plugins:[]}
});

Example

Dummy example where we save data to text field on submit form:

<form id="my-form">
    <div id="my-app"></div>
    <input type="hidden" id="#my-form__app-json">
    <input type="submit" value="Submit">
</form>
<script src="rubricate.js"></script>
// init application
let appHtmlElement = document.getElementById('my-app');
let app = Rubricate(streamHtmlElement);

// add form onsubmit event listener
let form = document.getElementById('my-form');
let jsonStringField = document.getElementById('#my-form__app-json');

form.addEventHandler('submit', () => {
    jsonStringField.value = JSON.stringify(app.getData());
});

FAQs

Package last updated on 07 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc