简体   繁体   English

有人可以给我一步一步的教程吗?

[英]Can someone give me a step by step tutorial?

I started to use codeMirror... But i don't really understand the manual and don't find a good tutorial on the internet.我开始使用codeMirror...但我不太了解手册,也没有在互联网上找到好的教程。 At the moment, i managed to get this:目前,我设法得到了这个:

var codeHtml = $(".codemirror-html") [0];
var editor = CodeMirror.fromTextArea(codeHtml, {
    mode:  "htmlmixed",
    lineNumbers: true
});

It does basically works, there are linenumbers and a textarea :D, but the mode doesnt' works.它基本上有效,有行号和文本区域:D,但模式不起作用。 It's just raw black text in the textarea.它只是 textarea 中的原始黑色文本。 I think I importet the needed Files:我想我导入所需的文件:

<script src="cm/lib/codemirror.js"></script>
<link rel="stylesheet" href="cm/lib/codemirror.css">
<script src="cm/mode/javascript/javascript.js"></script>
<script src="cm/mode/htmlmixed/htmlmixed.js"></script>

I don't know what I am doing wrong.. I alsow tried to add a theme, didn't worked as well.我不知道我做错了什么..我也尝试添加一个主题,但效果不佳。 Please, can someone show me how to do it?拜托,有人可以告诉我怎么做吗?

htmlmixed模式也取决于xmlcss模式,因此您必须为它们添加脚本标记。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM