2015-04-22 116 views

回答

1

我得到它的工作:從GitHub

  • 製造

    1. 簽出王牌包含某種加載樣板的bosun.js - 我基於d例子。然後,我可能會在bosun_highlight_rules.js中突出顯示規則。
    2. ran node ./Makefile.dryice.js -nc構建ace,並將生成的bosun.js(已嵌入各種需求)複製到我的項目中的ace目錄中。內置文件結束於/build/src-noconflict/mode-bosun.js

    bosun.js(預構建,在回購/lib/ace/mode

    define(function(require, exports, module) { 
    "use strict"; 
    
    var oop = require("../lib/oop"); 
    var TextMode = require("./text").Mode; 
    var BosunHighlightRules = require("./bosun_highlight_rules").BosunHighlightRules; 
    
    var Mode = function() { 
        this.HighlightRules = BosunHighlightRules; 
    }; 
    
    oop.inherits(Mode, TextMode); 
    
    (function() { 
        this.$id = "ace/mode/bosun"; 
    }).call(Mode.prototype); 
    
    exports.Mode = Mode; 
    }); 
    

    bosun_highlight_rules.js(同樣在/lib/ace/mode):

    define(function(require, exports, module) { 
    "use strict"; 
    
    var oop = require("../lib/oop"); 
    var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 
    
    var BosunHighlightRules = function() { 
    
        this.$rules = { 
         "start" : [ 
          {.... 
    }; 
    
    oop.inherits(BosunHighlightRules, TextHighlightRules); 
    
    exports.BosunHighlightRules = BosunHighlightRules; 
    });