# @writeaway/plugin-codemirror

> WriteAway is a JavaScript library for editing CMS pieces, pages and internationalisation on the client side.

Latest version **2.1.1** (published 2020-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @writeaway/plugin-codemirror
pnpm add @writeaway/plugin-codemirror
yarn add @writeaway/plugin-codemirror
bun add @writeaway/plugin-codemirror
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2020-10-20 |
| First published | 2020-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 607.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | SpiralScout |
| Maintainers | spiralscout.develop |

## Links

- npm: https://www.npmjs.com/package/@writeaway/plugin-codemirror
- Repository: https://github.com/redaxtor/redaxtor
- Homepage: https://github.com/redaxtor/redaxtor#readme
- Issues: https://github.com/redaxtor/redaxtor/issues
- npm.io page: https://npm.io/package/@writeaway/plugin-codemirror

## Recent versions

- 2.1.1 (latest) — 2020-10-20
- 2.1.0 — 2020-10-20
- 2.0.3 — 2020-10-14
- 2.0.2 — 2020-10-14

## README

# Code editor plugin for WriteAway

## Usage

```
npm install --save @writeaway/core
npm install --save @writeaway/plugin-codemirror
```

And then in code of bundle

```typescript
    import { WriteAwayCore } from '@writeaway/core';
    import { WriteAwayCodeMirror } from '@writeaway/plugin-codemirror';
    
    // Define which piece type is handled by which editor
    const components = {
      source: WriteAwayCodeMirror,
    };
    
    const writeaway = new WriteAwayCore({
      piecesOptions: {
        components,
        options: {
          source: {}, // Options for editor        
        }   
      },
    });
```

### Specifics

#### Data Types

Piece fields `data` has following fields

`html` - HTML code of piece node

`updateNode` - Optional. Default `true`. Indicates if that data should be applied to node. Specify `false` for nodes with `script` tags as repeatedly adding script tag can produce unexpected effects

#### Piece Options

No options for piece editors supported

---
_Source: https://npm.io/package/@writeaway/plugin-codemirror · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
