From 1bce1b2a608f9672a390fbd7d0728be262fdf02a Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 9 Sep 2014 21:22:15 +0400 Subject: [PATCH] cleanup tools directory --- Makefile.dryice.js | 2 +- tool/add_mode.js | 6 +++--- .../highlight_rules.tmpl.js} | 0 tool/{mode.tmpl.js => templates/mode.js} | 0 tool/{snippets.tmpl.js => templates/snippets.js} | 0 tool/{theme.tmpl.css => templates/theme.css} | 0 tool/{theme.tmpl.js => templates/theme.js} | 0 tool/tmlanguage.js | 4 ++-- tool/tmtheme.js | 4 ++-- 9 files changed, 8 insertions(+), 8 deletions(-) rename tool/{mode_highlight_rules.tmpl.js => templates/highlight_rules.tmpl.js} (100%) rename tool/{mode.tmpl.js => templates/mode.js} (100%) rename tool/{snippets.tmpl.js => templates/snippets.js} (100%) rename tool/{theme.tmpl.css => templates/theme.css} (100%) rename tool/{theme.tmpl.js => templates/theme.js} (100%) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index bac090f7..2763da89 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -536,7 +536,7 @@ function generateThemesModule(themes) { function addSnippetFile(modeName) { var snippetFilePath = ACE_HOME + "/lib/ace/snippets/" + modeName; if (!fs.existsSync(snippetFilePath + ".js")) { - copy.file(ACE_HOME + "/tool/snippets.tmpl.js", snippetFilePath + ".js", function(t) { + copy.file(ACE_HOME + "/tool/templates/snippets.js", snippetFilePath + ".js", function(t) { return t.replace(/%modeName%/g, modeName); }); } diff --git a/tool/add_mode.js b/tool/add_mode.js index d8110923..09b4a7e6 100644 --- a/tool/add_mode.js +++ b/tool/add_mode.js @@ -22,7 +22,7 @@ fs.writeFileSync(demoFilePath, "TODO add a nice demo!", "utf8"); console.log("Created demo file at: " + path.normalize(demoFilePath)); /** mode **/ -var template = fs.readFileSync(__dirname + "/mode.tmpl.js", "utf8"); +var template = fs.readFileSync(__dirname + "/templates/mode.js", "utf8"); var modePath = lib.AceLib + "ace/mode/" + name + ".js"; var text = lib.fillTemplate(template, { languageHighlightFilename: name, @@ -35,7 +35,7 @@ fs.writeFileSync(modePath, text); console.log("Created mode file at: " + path.normalize(modePath)); /** highlight rules **/ -template = fs.readFileSync(__dirname + "/mode_highlight_rules.tmpl.js", "utf8"); +template = fs.readFileSync(__dirname + "/templates/highlight_rules.js", "utf8"); var hlPath = lib.AceLib + "ace/mode/" + name + "_highlight_rules.js"; template = template.replace(/\/\* THIS[\s\S]*?\*{3}\/\s*/, ""); text = lib.fillTemplate(template, { @@ -60,7 +60,7 @@ fs.writeFileSync(hlPath, text); console.log("Created mode file at: " + path.normalize(hlPath)); /** snippets **/ -template = fs.readFileSync(__dirname + "/tmsnippets.tmpl.js", "utf8"); +template = fs.readFileSync(__dirname + "/templates/snippets.js", "utf8"); var snipetsPath = lib.AceLib + "ace/snippets/" + name + ".js"; text = lib.fillTemplate(template, { languagename: name, diff --git a/tool/mode_highlight_rules.tmpl.js b/tool/templates/highlight_rules.tmpl.js similarity index 100% rename from tool/mode_highlight_rules.tmpl.js rename to tool/templates/highlight_rules.tmpl.js diff --git a/tool/mode.tmpl.js b/tool/templates/mode.js similarity index 100% rename from tool/mode.tmpl.js rename to tool/templates/mode.js diff --git a/tool/snippets.tmpl.js b/tool/templates/snippets.js similarity index 100% rename from tool/snippets.tmpl.js rename to tool/templates/snippets.js diff --git a/tool/theme.tmpl.css b/tool/templates/theme.css similarity index 100% rename from tool/theme.tmpl.css rename to tool/templates/theme.css diff --git a/tool/theme.tmpl.js b/tool/templates/theme.js similarity index 100% rename from tool/theme.tmpl.js rename to tool/templates/theme.js diff --git a/tool/tmlanguage.js b/tool/tmlanguage.js index d6e5fd03..fc575339 100644 --- a/tool/tmlanguage.js +++ b/tool/tmlanguage.js @@ -141,8 +141,8 @@ function extractPatterns(tmRules) { // cli stuff -var modeTemplate = fs.readFileSync(__dirname + "/mode.tmpl.js", "utf8"); -var modeHighlightTemplate = fs.readFileSync(__dirname + "/mode_highlight_rules.tmpl.js", "utf8"); +var modeTemplate = fs.readFileSync(__dirname + "/templates/mode.js", "utf8"); +var modeHighlightTemplate = fs.readFileSync(__dirname + "/templates/highlight_rules.js", "utf8"); function convertLanguageFile(name) { var path = /^(\/|\w:)/.test(name) ? name : process.cwd() + "/" + name diff --git a/tool/tmtheme.js b/tool/tmtheme.js index 003748a3..e9e34f39 100755 --- a/tool/tmtheme.js +++ b/tool/tmtheme.js @@ -206,8 +206,8 @@ function quoteString(str) { return '"' + str.replace(/\\/, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\\n") + '"'; } -var cssTemplate = fs.readFileSync(__dirname + "/theme.tmpl.css", "utf8"); -var jsTemplate = fs.readFileSync(__dirname + "/theme.tmpl.js", "utf8"); +var cssTemplate = fs.readFileSync(__dirname + "/templates/theme.css", "utf8"); +var jsTemplate = fs.readFileSync(__dirname + "/templates/theme.js", "utf8"); function normalizeStylesheet(rules) { for (var i = rules.length; i--; ) {