Skip to content

Commit 34ba805

Browse files
committed
doc(theme): update document.
1 parent e16e45a commit 34ba805

File tree

36 files changed

+476
-17
lines changed

36 files changed

+476
-17
lines changed

themes/abcdef/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,21 @@
1717
npm install @uiw/codemirror-theme-abcdef --save
1818
```
1919

20+
```js
21+
import { EditorState } from '@codemirror/state';
22+
import { javascript } from '@codemirror/lang-javascript';
23+
import { abcdef } from '@uiw/codemirror-theme-abcdef';
24+
25+
const state = EditorState.create({
26+
doc: 'my source code',
27+
extensions: [abcdef, javascript({ jsx: true })],
28+
});
29+
```
30+
31+
Using in React:
32+
2033
```jsx
34+
import CodeMirror from '@uiw/react-codemirror';
2135
import { tags as t } from '@lezer/highlight';
2236
import { abcdef, abcdefInit } from '@uiw/codemirror-theme-abcdef';
2337

themes/abyss/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,21 @@ Abyss theme for cm6, generated from [vscode themes](https://github.com/microsoft
1919
npm install @uiw/codemirror-theme-abyss --save
2020
```
2121

22+
```js
23+
import { EditorState } from '@codemirror/state';
24+
import { javascript } from '@codemirror/lang-javascript';
25+
import { abyss } from '@uiw/codemirror-theme-abyss';
26+
27+
const state = EditorState.create({
28+
doc: 'my source code',
29+
extensions: [abyss, javascript({ jsx: true })],
30+
});
31+
```
32+
33+
Using in React:
34+
2235
```jsx
36+
import CodeMirror from '@uiw/react-codemirror';
2337
import { abyss, abyssInit } from '@uiw/codemirror-theme-abyss';
2438

2539
<CodeMirror theme={abyss} />

themes/all/README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@ import * as themes from '@uiw/codemirror-themes-all';
2121

2222
## Usage
2323

24+
```js
25+
import { EditorView } from '@codemirror/view';
26+
import { EditorState } from '@codemirror/state';
27+
import { javascript } from '@codemirror/lang-javascript';
28+
import { abcdef } from '@uiw/codemirror-themes-all';
29+
30+
const state = EditorState.create({
31+
doc: 'my source code',
32+
extensions: [abcdef, javascript({ jsx: true })],
33+
});
34+
35+
const view = new EditorView({
36+
parent: document.querySelector('#editor'),
37+
state,
38+
});
39+
```
40+
41+
Using in React:
42+
2443
```jsx
2544
import CodeMirror from '@uiw/react-codemirror';
2645
import { abcdef } from '@uiw/codemirror-themes-all';
@@ -42,23 +61,6 @@ function App() {
4261
export default App;
4362
```
4463

45-
```js
46-
import { EditorView } from '@codemirror/view';
47-
import { EditorState } from '@codemirror/state';
48-
import { javascript } from '@codemirror/lang-javascript';
49-
import { abcdef } from '@uiw/codemirror-themes-all';
50-
51-
const state = EditorState.create({
52-
doc: 'my source code',
53-
extensions: [abcdef, javascript({ jsx: true })],
54-
});
55-
56-
const view = new EditorView({
57-
parent: document.querySelector('#editor'),
58-
state,
59-
});
60-
```
61-
6264
## API
6365

6466
```ts

themes/androidstudio/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
npm install @uiw/codemirror-theme-androidstudio --save
1818
```
1919

20+
```js
21+
import { EditorState } from '@codemirror/state';
22+
import { javascript } from '@codemirror/lang-javascript';
23+
import { androidstudio } from '@uiw/codemirror-theme-androidstudio';
24+
25+
const state = EditorState.create({
26+
doc: 'my source code',
27+
extensions: [androidstudio, javascript({ jsx: true })],
28+
});
29+
```
30+
31+
Using in React:
32+
2033
```jsx
2134
import { tags as t } from '@lezer/highlight';
2235
import { androidstudio, androidstudioInit } from '@uiw/codemirror-theme-androidstudio';

themes/andromeda/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ Andromeda theme for cm6, generated from [vscode themes](https://github.com/Elive
1919
npm install @uiw/codemirror-theme-andromeda --save
2020
```
2121

22+
```js
23+
import { EditorState } from '@codemirror/state';
24+
import { javascript } from '@codemirror/lang-javascript';
25+
import { andromeda } from '@uiw/codemirror-theme-andromeda';
26+
27+
const state = EditorState.create({
28+
doc: 'my source code',
29+
extensions: [andromeda, javascript({ jsx: true })],
30+
});
31+
```
32+
33+
Using in React:
34+
2235
```jsx
2336
import { andromeda, andromedaInit } from '@uiw/codemirror-theme-andromeda';
2437

themes/atomone/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
npm install @uiw/codemirror-theme-atomone --save
1818
```
1919

20+
```js
21+
import { EditorState } from '@codemirror/state';
22+
import { javascript } from '@codemirror/lang-javascript';
23+
import { atomone } from '@uiw/codemirror-theme-atomone';
24+
25+
const state = EditorState.create({
26+
doc: 'my source code',
27+
extensions: [atomone, javascript({ jsx: true })],
28+
});
29+
```
30+
31+
Using in React:
32+
2033
```jsx
2134
import { tags as t } from '@lezer/highlight';
2235
import { atomone, atomoneInit } from '@uiw/codemirror-theme-atomone';

themes/aura/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
npm install @uiw/codemirror-theme-aura --save
1818
```
1919

20+
```js
21+
import { EditorState } from '@codemirror/state';
22+
import { javascript } from '@codemirror/lang-javascript';
23+
import { aura } from '@uiw/codemirror-theme-aura';
24+
25+
const state = EditorState.create({
26+
doc: 'my source code',
27+
extensions: [aura, javascript({ jsx: true })],
28+
});
29+
```
30+
31+
Using in React:
32+
2033
```jsx
2134
import { tags as t } from '@lezer/highlight';
2235
import { aura, auraInit } from '@uiw/codemirror-theme-aura';

themes/basic/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@
2121
npm install @uiw/codemirror-theme-basic --save
2222
```
2323

24+
```js
25+
import { EditorState } from '@codemirror/state';
26+
import { javascript } from '@codemirror/lang-javascript';
27+
import { basicLight, basicDark } from '@uiw/codemirror-theme-basic';
28+
29+
const state = EditorState.create({
30+
doc: 'my source code',
31+
extensions: [basicDark, javascript({ jsx: true })],
32+
});
33+
```
34+
35+
Using in React:
36+
2437
```jsx
2538
import { basicLight, basicLightInit, basicDark, basicDarkInit } from '@uiw/codemirror-theme-basic';
2639
// Or

themes/bbedit/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
npm install @uiw/codemirror-theme-bbedit --save
1818
```
1919

20+
```js
21+
import { EditorState } from '@codemirror/state';
22+
import { javascript } from '@codemirror/lang-javascript';
23+
import { bbedit } from '@uiw/codemirror-theme-bbedit';
24+
25+
const state = EditorState.create({
26+
doc: 'my source code',
27+
extensions: [bbedit, javascript({ jsx: true })],
28+
});
29+
```
30+
31+
Using in React:
32+
2033
```jsx
2134
import { tags as t } from '@lezer/highlight';
2235
import { bbedit, bbeditInit } from '@uiw/codemirror-theme-bbedit';

themes/bespin/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
npm install @uiw/codemirror-theme-bespin --save
1818
```
1919

20+
```js
21+
import { EditorState } from '@codemirror/state';
22+
import { javascript } from '@codemirror/lang-javascript';
23+
import { bespin } from '@uiw/codemirror-theme-bespin';
24+
25+
const state = EditorState.create({
26+
doc: 'my source code',
27+
extensions: [bespin, javascript({ jsx: true })],
28+
});
29+
```
30+
31+
Using in React:
32+
2033
```jsx
2134
import { tags as t } from '@lezer/highlight';
2235
import { bespin, bespinInit } from '@uiw/codemirror-theme-bespin';

0 commit comments

Comments
 (0)