codemirror 3.18 with enabled the fullscreen addon
This commit is contained in:
+70
-18
@@ -1,18 +1,31 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CodeMirror: Python mode</title>
|
||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||
<script src="../../lib/codemirror.js"></script>
|
||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||
<script src="python.js"></script>
|
||||
<link rel="stylesheet" href="../../doc/docs.css">
|
||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>CodeMirror: Python mode</h1>
|
||||
|
||||
|
||||
<title>CodeMirror: Python mode</title>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel=stylesheet href="../../doc/docs.css">
|
||||
|
||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||
<script src="../../lib/codemirror.js"></script>
|
||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||
<script src="python.js"></script>
|
||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||
<div id=nav>
|
||||
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">Home</a>
|
||||
<li><a href="../../doc/manual.html">Manual</a>
|
||||
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="../index.html">Language modes</a>
|
||||
<li><a class=active href="#">Python</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<article>
|
||||
<h2>Python mode</h2>
|
||||
|
||||
<div><textarea id="code" name="code">
|
||||
# Literals
|
||||
1234
|
||||
@@ -102,6 +115,34 @@ class ExampleClass(ParentClass):
|
||||
self.mixin = mixin
|
||||
|
||||
</textarea></div>
|
||||
|
||||
|
||||
<h2>Cython mode</h2>
|
||||
|
||||
<div><textarea id="code-cython" name="code-cython">
|
||||
|
||||
import numpy as np
|
||||
cimport cython
|
||||
from libc.math cimport sqrt
|
||||
|
||||
@cython.boundscheck(False)
|
||||
@cython.wraparound(False)
|
||||
def pairwise_cython(double[:, ::1] X):
|
||||
cdef int M = X.shape[0]
|
||||
cdef int N = X.shape[1]
|
||||
cdef double tmp, d
|
||||
cdef double[:, ::1] D = np.empty((M, M), dtype=np.float64)
|
||||
for i in range(M):
|
||||
for j in range(M):
|
||||
d = 0.0
|
||||
for k in range(N):
|
||||
tmp = X[i, k] - X[j, k]
|
||||
d += tmp * tmp
|
||||
D[i, j] = sqrt(d)
|
||||
return np.asarray(D)
|
||||
|
||||
</textarea></div>
|
||||
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
mode: {name: "python",
|
||||
@@ -111,9 +152,19 @@ class ExampleClass(ParentClass):
|
||||
indentUnit: 4,
|
||||
tabMode: "shift",
|
||||
matchBrackets: true
|
||||
});
|
||||
|
||||
CodeMirror.fromTextArea(document.getElementById("code-cython"), {
|
||||
mode: {name: "text/x-cython",
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 4,
|
||||
tabMode: "shift",
|
||||
matchBrackets: true
|
||||
});
|
||||
</script>
|
||||
<h2>Configuration Options:</h2>
|
||||
<h2>Configuration Options for Python mode:</h2>
|
||||
<ul>
|
||||
<li>version - 2/3 - The version of Python to recognize. Default is 2.</li>
|
||||
<li>singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.</li>
|
||||
@@ -127,9 +178,10 @@ class ExampleClass(ParentClass):
|
||||
<li>doubleDelimiters - RegEx - Regular Expressoin for double delimiters matching, default : <pre>^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))</pre></li>
|
||||
<li>tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default : <pre>^((//=)|(>>=)|(<<=)|(\\*\\*=))</pre></li>
|
||||
<li>identifiers - RegEx - Regular Expression for identifier, default : <pre>^[_A-Za-z][_A-Za-z0-9]*</pre></li>
|
||||
<li>extra_keywords - list of string - List of extra words ton consider as keywords</li>
|
||||
<li>extra_builtins - list of string - List of extra words ton consider as builtins</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p><strong>MIME types defined:</strong> <code>text/x-python</code>.</p>
|
||||
</body>
|
||||
</html>
|
||||
<p><strong>MIME types defined:</strong> <code>text/x-python</code> and <code>text/x-cython</code>.</p>
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user