Skip to content

Repository files navigation

RAML Editor

Build StatusDependency StatusDevDependency Status

This is a standalone/embeddable editor for RAML (Restful Api Modeling language) written in JavaScript.

Build and Run

Install global tools

npm install -g grunt-cli
npm install -g bower
npm install -g karma # Optional for running the test suite

Install node modules

npm install 

Install bower modules

bower install

Install webdriver required to run localScenario task

node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update

Run the application locally

grunt server

Run the test suite

grunt test

Build the application

grunt

Embedding

The following example details how to embed the API Designer:

<!doctype html><html><head><metacharset="utf-8"><title>My App</title><linkrel="stylesheet" href="styles/20dea081.main.css"><linkhref="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet"></head><bodyng-app="ramlEditorApp"><divclass="container" ng-include="" src="'views/raml-editor-main.tmpl.html'"></div><scriptsrc="scripts/d78281b9.vendor.js"></script><scriptsrc="scripts/8a9fbe21.scripts.js"></script><script>// This part is needed only if you want to provide your own Persistance Implementation// Angular Module must match "ramlEditorApp"angular.module('ramlEditorApp').factory('MyFileSystem',function($q,config,eventService){varservice={};service.directory=function(path){vardeferred=$q.defer();// Your magic goes here:// Do deferred.resolve(data); to fulfull the promise or// deferred.reject(error); to reject it.returndeferred.promise;};service.load=function(path,name){vardeferred=$q.defer();// Your magic goes here:// Do deferred.resolve(data); to fulfull the promise or// deferred.reject(error); to reject it.returndeferred.promise;};service.remove=function(path,name){vardeferred=$q.defer();// Your magic goes here:// Do deferred.resolve(data); to fulfull the promise or// deferred.reject(error); to reject it.returndeferred.promise;};service.save=function(path,name,contents){vardeferred=$q.defer();// Your magic goes here:// Do deferred.resolve(data); to fulfull the promise or// deferred.reject(error); to reject it.returndeferred.promise;};returnservice;}).run(function(MyFileSystem,config,eventService){// Set MyFileSystem as the filesystem to useconfig.set('fsFactory','MyFileSystem');// In case you want to send notifications to the user// (for instance, that he must login to save).// The expires flags means whether// it should be hidden after a period of time or the// user should dismiss it manually.eventService.broadcast('event:notification',{message: 'File saved.',expires: true});});</script></body></html>

Contributor's Agreement

To contribute source code to this repository, please read our contributor's agreement, and then execute it by running this notebook and following the instructions: https://api-notebook.anypoint.mulesoft.com/notebooks/#380297ed0e474010ff43

License

Copyright 2013 MuleSoft, Inc. Licensed under the Common Public Attribution License (CPAL), Version 1.0

About

A web editor for creating and sharing RAML API specifications

Resources

Stars

0 stars

Watchers

5 watching

Forks

Releases

Packages

Contributors