Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/editor-js/underline
Inline tool for underlining text fragments
https://github.com/editor-js/underline
Last synced: about 2 months ago
JSON representation
Inline tool for underlining text fragments
- Host: GitHub
- URL: https://github.com/editor-js/underline
- Owner: editor-js
- Created: 2019-10-25T14:08:29.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T23:23:15.000Z (almost 2 years ago)
- Last Synced: 2024-05-19T14:30:41.486Z (8 months ago)
- Language: JavaScript
- Size: 3.88 MB
- Stars: 13
- Watchers: 3
- Forks: 21
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-editorjs - @editorjs/underline
README
![](https://badgen.net/badge/Editor.js/v2.0/blue)
# Underline Tool
Inline tool for underlining text fragments for the [Editor.js](https://github.com/codex-team/editor.js)![](editorjs-underline.gif)
## Installation
### Install via NPM
Get the package
```shell
npm i --save @editorjs/underline
``````shell
yarn add @editorjs/underline
```Include module at your application
```javascript
import Underline from '@editorjs/underline';
```### Download to your project's source dir
1. Upload folder `dist` from repository
2. Add `dist/bundle.js` file to your page.### Load from CDN
You can load the package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@editorjs/underline) and require the script on a page with Editor.js.
```html
```
## Usage
Add a new Tool to the `tools` property of the Editor.js initial config.
```javascript
import EditorJs from '@editorjs/editorjs';
import Underline from '@editorjs/underline';var editor = new EditorJS({
// ...
tools: {
// ...
underline: Underline
},
});
```## Config Params
This Tool has no config params
## Output data
Underlined text will be wrapped with a `u` tag with an `cdx-underline` class.
```json
{
"type" : "text",
"data" : {
"text" : "Create a directory for your module, enter it and run npm init command."
}
}
```