Skip to content

Commit c4d24ae

Browse files
Code Tool version 2.0
1 parent ebb9b39 commit c4d24ae

20 files changed

+5567
-341
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/*
22
npm-debug.log
3-
.idea/*
3+
.idea/*
4+
.DS_Store

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 CodeX Editor
3+
Copyright (c) 2018 CodeX
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+54-28
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,77 @@
1-
![](https://badgen.net/badge/CodeX%20Editor/v1.0/gray)
1+
![](https://badgen.net/badge/CodeX%20Editor/v2.0/blue)
22

3-
# Code Plugin for CodeX Editor
3+
# Code Tool for CodeX Editor
44

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.
66

7-
## Install via npm
7+
![](https://capella.pics/77cc593f-0384-4df2-b9d1-d9c7d6d96b7d.jpg)
88

9-
```shell
10-
npm i --save codex.editor.code
11-
```
9+
## Installation
1210

13-
#### Connect with Webpack
11+
### Install via NPM
1412

15-
Include module in your application
13+
Get the package
1614

17-
```js
18-
require('codex.editor.code');
15+
```shell
16+
npm i --save-dev codex.editor.code
1917
```
2018

21-
Include CSS file
19+
Include module at your application
2220

23-
```css
24-
@import url("~codex.editor.code/lib/code.css");
21+
```javascript
22+
const RawTool = require('codex.editor.code');
2523
```
2624

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.
2829

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
3131

32-
## CodeX Editor
32+
You can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/codex.editor.code).
3333

34-
API oriented, open-source, block-styled Edtior.
34+
`https://cdn.jsdelivr.net/npm/[email protected]`
3535

36-
https://github.com/codex-team/codex.editor
36+
Require this script on a page with CodeX Editor.
3737

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+
```
3958

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
4260

43-
https://ifmo.su
61+
| Field | Type | Description |
62+
| ----------- | -------- | -------------------------------|
63+
| placeholder | `string` | Code Tool's placeholder string |
4464

45-
### Follow us!
65+
## Output data
4666

47-
VK: https://vk.com/codex_team
67+
This Tool returns raw code.
4868

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+
```
5077

51-
Instagram: https://www.instagram.com/codex_team

dist/bundle.js

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

entry.js

-10
This file was deleted.

lib/bundle.css

-2
This file was deleted.

lib/bundle.css.map

-1
This file was deleted.

lib/bundle.js

-2
This file was deleted.

lib/bundle.js.map

-1
This file was deleted.

0 commit comments

Comments
 (0)