Skip to content

Commit

Permalink
doc(theme): update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Mar 26, 2024
1 parent e16e45a commit 34ba805
Show file tree
Hide file tree
Showing 36 changed files with 476 additions and 17 deletions.
14 changes: 14 additions & 0 deletions themes/abcdef/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,21 @@
npm install @uiw/codemirror-theme-abcdef --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { abcdef } from '@uiw/codemirror-theme-abcdef';

const state = EditorState.create({
doc: 'my source code',
extensions: [abcdef, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import CodeMirror from '@uiw/react-codemirror';
import { tags as t } from '@lezer/highlight';
import { abcdef, abcdefInit } from '@uiw/codemirror-theme-abcdef';

Expand Down
14 changes: 14 additions & 0 deletions themes/abyss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,21 @@ Abyss theme for cm6, generated from [vscode themes](https://github.com/microsoft
npm install @uiw/codemirror-theme-abyss --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { abyss } from '@uiw/codemirror-theme-abyss';

const state = EditorState.create({
doc: 'my source code',
extensions: [abyss, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import CodeMirror from '@uiw/react-codemirror';
import { abyss, abyssInit } from '@uiw/codemirror-theme-abyss';

<CodeMirror theme={abyss} />
Expand Down
36 changes: 19 additions & 17 deletions themes/all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@ import * as themes from '@uiw/codemirror-themes-all';

## Usage

```js
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { abcdef } from '@uiw/codemirror-themes-all';

const state = EditorState.create({
doc: 'my source code',
extensions: [abcdef, javascript({ jsx: true })],
});

const view = new EditorView({
parent: document.querySelector('#editor'),
state,
});
```

Using in React:

```jsx
import CodeMirror from '@uiw/react-codemirror';
import { abcdef } from '@uiw/codemirror-themes-all';
Expand All @@ -42,23 +61,6 @@ function App() {
export default App;
```

```js
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { abcdef } from '@uiw/codemirror-themes-all';

const state = EditorState.create({
doc: 'my source code',
extensions: [abcdef, javascript({ jsx: true })],
});

const view = new EditorView({
parent: document.querySelector('#editor'),
state,
});
```

## API

```ts
Expand Down
13 changes: 13 additions & 0 deletions themes/androidstudio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
npm install @uiw/codemirror-theme-androidstudio --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { androidstudio } from '@uiw/codemirror-theme-androidstudio';

const state = EditorState.create({
doc: 'my source code',
extensions: [androidstudio, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { tags as t } from '@lezer/highlight';
import { androidstudio, androidstudioInit } from '@uiw/codemirror-theme-androidstudio';
Expand Down
13 changes: 13 additions & 0 deletions themes/andromeda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ Andromeda theme for cm6, generated from [vscode themes](https://github.com/Elive
npm install @uiw/codemirror-theme-andromeda --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { andromeda } from '@uiw/codemirror-theme-andromeda';

const state = EditorState.create({
doc: 'my source code',
extensions: [andromeda, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { andromeda, andromedaInit } from '@uiw/codemirror-theme-andromeda';

Expand Down
13 changes: 13 additions & 0 deletions themes/atomone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
npm install @uiw/codemirror-theme-atomone --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { atomone } from '@uiw/codemirror-theme-atomone';

const state = EditorState.create({
doc: 'my source code',
extensions: [atomone, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { tags as t } from '@lezer/highlight';
import { atomone, atomoneInit } from '@uiw/codemirror-theme-atomone';
Expand Down
13 changes: 13 additions & 0 deletions themes/aura/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
npm install @uiw/codemirror-theme-aura --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { aura } from '@uiw/codemirror-theme-aura';

const state = EditorState.create({
doc: 'my source code',
extensions: [aura, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { tags as t } from '@lezer/highlight';
import { aura, auraInit } from '@uiw/codemirror-theme-aura';
Expand Down
13 changes: 13 additions & 0 deletions themes/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@
npm install @uiw/codemirror-theme-basic --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { basicLight, basicDark } from '@uiw/codemirror-theme-basic';

const state = EditorState.create({
doc: 'my source code',
extensions: [basicDark, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { basicLight, basicLightInit, basicDark, basicDarkInit } from '@uiw/codemirror-theme-basic';
// Or
Expand Down
13 changes: 13 additions & 0 deletions themes/bbedit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
npm install @uiw/codemirror-theme-bbedit --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { bbedit } from '@uiw/codemirror-theme-bbedit';

const state = EditorState.create({
doc: 'my source code',
extensions: [bbedit, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { tags as t } from '@lezer/highlight';
import { bbedit, bbeditInit } from '@uiw/codemirror-theme-bbedit';
Expand Down
13 changes: 13 additions & 0 deletions themes/bespin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
npm install @uiw/codemirror-theme-bespin --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { bespin } from '@uiw/codemirror-theme-bespin';

const state = EditorState.create({
doc: 'my source code',
extensions: [bespin, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { tags as t } from '@lezer/highlight';
import { bespin, bespinInit } from '@uiw/codemirror-theme-bespin';
Expand Down
13 changes: 13 additions & 0 deletions themes/console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ One of the usages for react-codemirror is a logger component, but there is no th
npm install @uiw/codemirror-theme-console --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { consoleLight, consoleDark } from '@uiw/codemirror-theme-console';

const state = EditorState.create({
doc: 'my source code',
extensions: [consoleDark],
});
```

Using in React:

```jsx
import { consoleLight, consoleLightInit, consoleDark, consoleDarkInit } from '@uiw/codemirror-theme-console';
// Or
Expand Down
13 changes: 13 additions & 0 deletions themes/copilot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ Copilot theme for cm6, generated from [copilot-theme](https://github.com/benjami
npm install @uiw/codemirror-theme-copilot --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { copilot } from '@uiw/codemirror-theme-copilot';

const state = EditorState.create({
doc: 'my source code',
extensions: [copilot, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { copilot, copilotInit } from '@uiw/codemirror-theme-copilot';

Expand Down
13 changes: 13 additions & 0 deletions themes/darcula/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
npm install @uiw/codemirror-theme-darcula --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { darcula } from '@uiw/codemirror-theme-darcula';

const state = EditorState.create({
doc: 'my source code',
extensions: [darcula, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { tags as t } from '@lezer/highlight';
import { darcula, darculaInit } from '@uiw/codemirror-theme-darcula';
Expand Down
13 changes: 13 additions & 0 deletions themes/dracula/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
npm install @uiw/codemirror-theme-dracula --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { dracula } from '@uiw/codemirror-theme-dracula';

const state = EditorState.create({
doc: 'my source code',
extensions: [dracula, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { tags as t } from '@lezer/highlight';
import { dracula, draculaInit } from '@uiw/codemirror-theme-dracula';
Expand Down
13 changes: 13 additions & 0 deletions themes/duotone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@
npm install @uiw/codemirror-theme-duotone --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { duotoneLight, duotoneDark } from '@uiw/codemirror-theme-duotone';

const state = EditorState.create({
doc: 'my source code',
extensions: [duotoneDark, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { duotoneLight, duotoneLightInit, duotoneDark, duotoneDarkInit } from '@uiw/codemirror-theme-duotone';

Expand Down
13 changes: 13 additions & 0 deletions themes/eclipse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
npm install @uiw/codemirror-theme-eclipse --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { eclipse } from '@uiw/codemirror-theme-eclipse';

const state = EditorState.create({
doc: 'my source code',
extensions: [eclipse, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { defaultSettingsEclipse } from '@uiw/codemirror-theme-eclipse';
import { eclipse, eclipseInit } from '@uiw/codemirror-theme-eclipse';
Expand Down
13 changes: 13 additions & 0 deletions themes/github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@
npm install @uiw/codemirror-theme-github --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { githubLight, githubDark } from '@uiw/codemirror-theme-github';

const state = EditorState.create({
doc: 'my source code',
extensions: [githubDark, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { githubLight, githubLightInit, githubDark, githubDarkInit } from '@uiw/codemirror-theme-github';

Expand Down
13 changes: 13 additions & 0 deletions themes/gruvbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ This package implements the [gruvbox](https://github.com/morhetz/gruvbox) light
npm install @uiw/codemirror-theme-gruvbox-dark --save
```

```js
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { gruvboxDark } from '@uiw/codemirror-theme-gruvbox-dark';

const state = EditorState.create({
doc: 'my source code',
extensions: [gruvboxDark, javascript({ jsx: true })],
});
```

Using in React:

```jsx
import { gruvboxDark, gruvboxDarkInit, gruvboxLight, gruvboxLightInit } from '@uiw/codemirror-theme-nord';

Expand Down
Loading

0 comments on commit 34ba805

Please sign in to comment.