|
1 |
| - |
| 1 | + |
2 | 2 |
|
3 |
| -# Code Plugin for CodeX Editor |
| 3 | +# Code Tool for CodeX Editor |
4 | 4 |
|
5 |
| -Paste code examples into your article. |
| 5 | +Code Tool for the [CodeX Editor](https://ifmo.su/editor) allows to include code examples in your articles. |
6 | 6 |
|
7 |
| -## Install via npm |
| 7 | + |
8 | 8 |
|
9 |
| -```shell |
10 |
| -npm i --save codex.editor.code |
11 |
| -``` |
| 9 | +## Installation |
12 | 10 |
|
13 |
| -#### Connect with Webpack |
| 11 | +### Install via NPM |
14 | 12 |
|
15 |
| -Include module in your application |
| 13 | +Get the package |
16 | 14 |
|
17 |
| -```js |
18 |
| -require('codex.editor.code'); |
| 15 | +```shell |
| 16 | +npm i --save-dev codex.editor.code |
19 | 17 | ```
|
20 | 18 |
|
21 |
| -Include CSS file |
| 19 | +Include module at your application |
22 | 20 |
|
23 |
| -```css |
24 |
| -@import url("~codex.editor.code/lib/code.css"); |
| 21 | +```javascript |
| 22 | +const RawTool = require('codex.editor.code'); |
25 | 23 | ```
|
26 | 24 |
|
27 |
| -## Install directly |
| 25 | +### Download to your project's source dir |
| 26 | + |
| 27 | +1. Upload folder `dist` from repository |
| 28 | +2. Add `dist/bundle.js` file to your page. |
28 | 29 |
|
29 |
| -1. Download folder `lib` from repository |
30 |
| -2. Add `lib/bundle.js` and `lib/bundle.css` files to your page. |
| 30 | +### Load from CDN |
31 | 31 |
|
32 |
| -## CodeX Editor |
| 32 | +You can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/codex.editor.code). |
33 | 33 |
|
34 |
| -API oriented, open-source, block-styled Edtior. |
| 34 | +`https://cdn.jsdelivr.net/npm/[email protected]` |
35 | 35 |
|
36 |
| -https://github.com/codex-team/codex.editor |
| 36 | +Require this script on a page with CodeX Editor. |
37 | 37 |
|
38 |
| -## Authors |
| 38 | +```html |
| 39 | +<script src="..."></script> |
| 40 | +``` |
| 41 | + |
| 42 | +## Usage |
| 43 | + |
| 44 | +Add a new Tool to the `tools` property of the CodeX Editor initial config. |
| 45 | + |
| 46 | +```javascript |
| 47 | +var editor = CodexEditor({ |
| 48 | + ... |
| 49 | + |
| 50 | + tools: { |
| 51 | + ... |
| 52 | + code: Code, |
| 53 | + } |
| 54 | + |
| 55 | + ... |
| 56 | +}); |
| 57 | +``` |
39 | 58 |
|
40 |
| -We are small team of Web-developing fans consisting of IFMO students and graduates located in St. Petersburg, Russia. |
41 |
| -Fell free to give us a feedback on < a href= "mailto::[email protected]"> [email protected]</ a> |
| 59 | +## Config Params |
42 | 60 |
|
43 |
| -https://ifmo.su |
| 61 | +| Field | Type | Description | |
| 62 | +| ----------- | -------- | -------------------------------| |
| 63 | +| placeholder | `string` | Code Tool's placeholder string | |
44 | 64 |
|
45 |
| -### Follow us! |
| 65 | +## Output data |
46 | 66 |
|
47 |
| -VK: https://vk.com/codex_team |
| 67 | +This Tool returns raw code. |
48 | 68 |
|
49 |
| -Telegram: https://t.me/codex_team |
| 69 | +```json |
| 70 | +{ |
| 71 | + "type" : "code", |
| 72 | + "data" : { |
| 73 | + "code": "body {\n font-size: 14px;\n line-height: 16px;\n}", |
| 74 | + } |
| 75 | +} |
| 76 | +``` |
50 | 77 |
|
51 |
| -Instagram: https://www.instagram.com/codex_team |
|
0 commit comments