MVC Razor 语法的 Ace 编辑器插件 [英] Ace Editor Plugin for MVC Razor syntax

查看:35
本文介绍了MVC Razor 语法的 Ace 编辑器插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何为 ACE 编辑器创建插件以支持 Razor 语法.Ace 主页:http://ace.c9.io

How i can create a plugin for ACE Editor to support Razor syntax. Ace Home Page: http://ace.c9.io

推荐答案

这里是 ACE 中 Razor 语法高亮的开始实现.所有功劳归于Andrey Shchekin,Stack Overflow 的成员.

Here is a started implementation of Razor syntax highlighting in ACE. All credits goes to Andrey Shchekin a member of Stack Overflow.

从 GIT 下载他的 ACE 分支.在 Node.JS 命令提示符下,转到目录并执行以下操作:

Download his branch of the ACE from GIT. In Node.JS command prompt go to the directory and do the following:

  1. npm install
  2. node Makefile.dryice.js full

然后复制您要使用的src文件夹并像这样配置ace.

Then copy the src folder that you want to work with and configure ace like this.

var editor = ace.edit("editor");
editor.setTheme("ace/theme/chrome_razor"); //Razor CSS
editor.getSession().setMode("ace/mode/razor"); //Razor Syntax!!!

外观示例

非常感谢安德烈 (Andrey) 开始这项工作,希望现在有更多人可以修补它.

这篇关于MVC Razor 语法的 Ace 编辑器插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆