Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/editor-js/inline-code
Inline-Code Tool for Editor.js 2.0
https://github.com/editor-js/inline-code
code codex codex-editor inline-tool plugin
Last synced: 3 months ago
JSON representation
Inline-Code Tool for Editor.js 2.0
- Host: GitHub
- URL: https://github.com/editor-js/inline-code
- Owner: editor-js
- License: mit
- Created: 2018-08-01T11:31:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-26T20:07:13.000Z (10 months ago)
- Last Synced: 2024-05-19T14:30:39.330Z (6 months ago)
- Topics: code, codex, codex-editor, inline-tool, plugin
- Language: JavaScript
- Homepage:
- Size: 728 KB
- Stars: 41
- Watchers: 1
- Forks: 23
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-editorjs - @editorjs/inline-code - fragments (Tools / Inline Tools)
README
![](https://badgen.net/badge/Editor.js/v2.0/blue)
# InlineCode Tool
Inline Tool for marking code-fragments for the [Editor.js](https://ifmo.su/editor).
![](assets/example.gif)
## Installation
Get the package
```shell
yarn add @editorjs/inline-code
```Include module at your application
```javascript
import InlineCode from '@editorjs/inline-code';
```Optionally, you can load this tool from CDN [JsDelivr CDN](https://cdn.jsdelivr.net/npm/@editorjs/inline-code@latest)
## Usage
Add a new Tool to the `tools` property of the Editor.js initial config.
```javascript
var editor = EditorJS({
...
tools: {
...
inlineCode: {
class: InlineCode,
shortcut: 'CMD+SHIFT+M',
},
},
...
});
```## Config Params
This Tool has no config params
## Output data
Marked text will be wrapped with a `span` tag with an `inline-code` class.
```json
{
"type" : "text",
"data" : {
"text" : "Create a directory for your module, enter it and run npm init command."
}
}
```