分享个在线源码编辑器:edit_area
他支持我们在线编辑或添加源码,这样不需要开发环境照样玩。
他支持对以下多种源码高亮显示:
以下是关于html源码的效果:
另外,他还支持查找内容,字体大小,跳转到指定行等。。。
只需要初始化以下信息便可使用:
editAreaLoader.init({
id: "example_1" // id of the textarea to transform,文本域的id
,start_highlight: true // if start with highlight,是否高亮
,allow_resize: "both"
,allow_toggle: true
,word_wrap: true
,language: "en"
,syntax: "html" //显示什么类型的源码,这里我们只要说明是什么类型源码即可
});
附件是完整实例:
只需要打开/exemples/exemple_full.html即可查看效果。
|