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

+14
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

+14
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

+19-17
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

+13
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

+13
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

+13
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

+13
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

+13
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

+13
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

+13
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';

themes/console/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ One of the usages for react-codemirror is a logger component, but there is no th
2525
npm install @uiw/codemirror-theme-console --save
2626
```
2727

28+
```js
29+
import { EditorState } from '@codemirror/state';
30+
import { javascript } from '@codemirror/lang-javascript';
31+
import { consoleLight, consoleDark } from '@uiw/codemirror-theme-console';
32+
33+
const state = EditorState.create({
34+
doc: 'my source code',
35+
extensions: [consoleDark],
36+
});
37+
```
38+
39+
Using in React:
40+
2841
```jsx
2942
import { consoleLight, consoleLightInit, consoleDark, consoleDarkInit } from '@uiw/codemirror-theme-console';
3043
// Or

themes/copilot/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ Copilot theme for cm6, generated from [copilot-theme](https://github.com/benjami
1919
npm install @uiw/codemirror-theme-copilot --save
2020
```
2121

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

themes/darcula/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
npm install @uiw/codemirror-theme-darcula --save
1818
```
1919

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

themes/dracula/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
npm install @uiw/codemirror-theme-dracula --save
1818
```
1919

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

themes/duotone/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@
2121
npm install @uiw/codemirror-theme-duotone --save
2222
```
2323

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

themes/eclipse/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
npm install @uiw/codemirror-theme-eclipse --save
1818
```
1919

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

themes/github/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@
2121
npm install @uiw/codemirror-theme-github --save
2222
```
2323

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

themes/gruvbox/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ This package implements the [gruvbox](https://github.com/morhetz/gruvbox) light
2323
npm install @uiw/codemirror-theme-gruvbox-dark --save
2424
```
2525

26+
```js
27+
import { EditorState } from '@codemirror/state';
28+
import { javascript } from '@codemirror/lang-javascript';
29+
import { gruvboxDark } from '@uiw/codemirror-theme-gruvbox-dark';
30+
31+
const state = EditorState.create({
32+
doc: 'my source code',
33+
extensions: [gruvboxDark, javascript({ jsx: true })],
34+
});
35+
```
36+
37+
Using in React:
38+
2639
```jsx
2740
import { gruvboxDark, gruvboxDarkInit, gruvboxLight, gruvboxLightInit } from '@uiw/codemirror-theme-nord';
2841

0 commit comments

Comments
 (0)