Socket
Socket
Sign inDemoInstall

fractus

Package Overview
Dependencies
8
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fractus

a browser-based editor


Version published
Weekly downloads
4
increased by100%
Maintainers
1
Install size
8.03 MB
Created
Weekly downloads
 

Readme

Source

Fractus Editor

This is the editor component of Stratus Editor.

Standalone

Be sure you have stratus-bundle installed, along with any syntaxes you plan on using.

To build the standalone editor:

$ npm install fractus -g
# Pass the languages you want to include,
# and the paths to the JS and CSS files to write.
$ fractus -l Ruby,JavaScript -j ./fractus.js -c ./fractus.css

Then, include the JavaScript and CSS files that it writes in your HTML.

This will turn $("#some-element") into an editor:

jQuery(function($) {
  var fractus = require("fractus");
  var editor  = fractus($("#some-element"),
    { text:   "some\ntext"
    , syntax: window.fractusBundles["Ruby"]
  });
});

API

For Fractus' API, see the Stratus documentation.

editor.text()

Get the editor's text:

editor.text();
// => "some\ntext"

CLI

Usage: fractus.coffee [options]

Options:

  -h, --help           output usage information
  -V, --version        output the version number
  -l, --langs <langs>  Bundle the comma-separated syntaxes (required).
  -j, --js <file>      The JavaScript output file.
  -c, --css <file>     The CSS output file.
  -t, --theme <theme>  The theme name.
  -q, --jquery         Dont include the jQuery source

License

See LICENSE.

Keywords

FAQs

Last updated on 05 Feb 2012

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc