@@ -19,19 +19,26 @@ we have a [code of
1919conduct] ( http://contributor-covenant.org/version/1/1/0/ ) that applies
2020to communication around the project.
2121
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+
2235# API Reference
2336
2437<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 >
3240
33- <dd ><p >Completion source that looks up locally defined names in
34- Python code.</p >
41+ <dd ><p >Python language support.</p >
3542</dd >
3643<dt id =" user-content-pythonlanguage " >
3744 <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>
4047parser</a >, extended with
4148highlighting and indentation information.</p >
4249</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 >
4552
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 >
4760</dd >
48- </dl >
61+ </dl >
0 commit comments