webgme-simple-nodes
A WebGME plugin simplifying arbitrary code generation from models
Last updated 3 years ago by brollb .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install webgme-simple-nodes 
SYNC missed versions from official npm registry.

Build Status Code Climate npm

'Simple Nodes' Plugin for WebGME

This plugin converts the WebGME nodes to simple JSON objects (where all children are topologically sorted) then calls a custom Generator which can be created to create custom text files using these simplified data types.

Overview

This library is composed of two objects: SimpleNodes and the Generator. The SimpleNodes converts the WebGME nodes into JSON then passes them to an Generator which handles creating any necessary files (from any templates, etc).

Quick Start (for the example)

  • Clone this repo
  • Install dependencies (with npm install)
  • Start project (with npm start - make sure you have a local mongodb instance running)
  • Navigate to http://localhost:8888 in a browser
  • Create a new project from the seed ExampleModel
  • Open the Example box
  • Click the "play button" in the top left and run ExamplePlugin

Quick Start (for development)

Installation

If you are using the webgme-cli, you can add this to an existing WebGME app with:

webgme import plugin SimpleNodes brollb/webgme-simple-nodes

Usage

The SimpleNodes can be extended in your plugin with

define(['SimpleNodes/SimpleNodes',
        ...], function(SimpleNodes,
        ...) {

    'use strict';
    var MyPlugin = function() {
        SimpleNodes.call(this);
        ...
    };

    _.extend(MyPlugin.prototype, SimpleNodes.prototype);

An Generator can be created similarly with

define(['SimpleNodes/Generator',
        ...], function(Generator,
                       ...) {
    'use strict';

    var MyGenerator = function() {
        this.template = /* define template info here */
    };

    _.extend(MyGenerator.prototype, Generator.prototype);

More details on using these can be found in the example in src/plugins/ExamplePlugin

Current Tags

  • 2.1.3                                ...           latest (3 years ago)

8 Versions

  • 2.1.3                                ...           3 years ago
  • 2.1.2                                ...           3 years ago
  • 2.1.1                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.2                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (5)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |