@@ -19,19 +19,26 @@ we have a [code of
19
19
conduct] ( http://contributor-covenant.org/version/1/1/0/ ) that applies
20
20
to communication around the project.
21
21
22
+ ## Usage
23
+
24
+ ``` javascript
25
+ import {EditorView , basicSetup } from " codemirror"
26
+ import {python } from " @codemirror/lang-python"
27
+
28
+ const view = new EditorView ({
29
+ parent: document .body ,
30
+ doc: ` print("Hello world")` ,
31
+ extensions: [basicSetup, python ()]
32
+ })
33
+ ```
34
+
22
35
# API Reference
23
36
24
37
<dl >
25
- <dt id =" user-content-globalcompletion " >
26
- <code ><strong ><a href =" #user-content-globalcompletion " >globalCompletion</a ></strong >: <a href =" https://codemirror.net/docs/ref#autocomplete.CompletionSource " >CompletionSource</a ></code ></dt >
27
-
28
- <dd ><p >Autocompletion for built-in Python globals and keywords.</p >
29
- </dd >
30
- <dt id =" user-content-localcompletionsource " >
31
- <code ><strong ><a href =" #user-content-localcompletionsource " >localCompletionSource</a ></strong >(<a id =" user-content-localcompletionsource^context " href =" #user-content-localcompletionsource^context " >context</a >: <a href =" https://codemirror.net/docs/ref#autocomplete.CompletionContext " >CompletionContext</a >) → <a href =" https://codemirror.net/docs/ref#autocomplete.CompletionResult " >CompletionResult</a > | <a href =" https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null " >null</a ></code ></dt >
38
+ <dt id =" user-content-python " >
39
+ <code ><strong ><a href =" #user-content-python " >python</a ></strong >() → <a href =" https://codemirror.net/docs/ref#language.LanguageSupport " >LanguageSupport</a ></code ></dt >
32
40
33
- <dd ><p >Completion source that looks up locally defined names in
34
- Python code.</p >
41
+ <dd ><p >Python language support.</p >
35
42
</dd >
36
43
<dt id =" user-content-pythonlanguage " >
37
44
<code ><strong ><a href =" #user-content-pythonlanguage " >pythonLanguage</a ></strong >: <a href =" https://codemirror.net/docs/ref#language.LRLanguage " >LRLanguage</a ></code ></dt >
@@ -40,9 +47,15 @@ Python code.</p>
40
47
parser</a >, extended with
41
48
highlighting and indentation information.</p >
42
49
</dd >
43
- <dt id =" user-content-python " >
44
- <code ><strong ><a href =" #user-content-python " >python </a ></strong >() → <a href =" https://codemirror.net/docs/ref#language.LanguageSupport " >LanguageSupport </a ></code ></dt >
50
+ <dt id =" user-content-globalcompletion " >
51
+ <code ><strong ><a href =" #user-content-globalcompletion " >globalCompletion </a ></strong >: <a href =" https://codemirror.net/docs/ref#autocomplete.CompletionSource " >CompletionSource </a ></code ></dt >
45
52
46
- <dd ><p >Python language support.</p >
53
+ <dd ><p >Autocompletion for built-in Python globals and keywords.</p >
54
+ </dd >
55
+ <dt id =" user-content-localcompletionsource " >
56
+ <code ><strong ><a href =" #user-content-localcompletionsource " >localCompletionSource</a ></strong >(<a id =" user-content-localcompletionsource^context " href =" #user-content-localcompletionsource^context " >context</a >: <a href =" https://codemirror.net/docs/ref#autocomplete.CompletionContext " >CompletionContext</a >) → <a href =" https://codemirror.net/docs/ref#autocomplete.CompletionResult " >CompletionResult</a > | <a href =" https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null " >null</a ></code ></dt >
57
+
58
+ <dd ><p >Completion source that looks up locally defined names in
59
+ Python code.</p >
47
60
</dd >
48
- </dl >
61
+ </dl >
0 commit comments