All Projects → editor-js → link

editor-js / link

Licence: MIT license
Link Tool for Editor.js 2.0

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to link

simple-image
Simple Image Tool for Editor.js 2.0
Stars: ✭ 36 (-40.98%)
Mutual labels:  codex, codex-editor
inline-code
Inline-Code Tool for Editor.js 2.0
Stars: ✭ 32 (-47.54%)
Mutual labels:  codex, codex-editor
list
List Tool for Editor.js 2.0
Stars: ✭ 40 (-34.43%)
Mutual labels:  codex-editor
editorjs-style
Inline-style Tool for Editor.js
Stars: ✭ 23 (-62.3%)
Mutual labels:  codex
editorjs-inline
Inline-Editor.js Tool for Editor.js
Stars: ✭ 23 (-62.3%)
Mutual labels:  codex
language-planner
Official Code for "Language Models as Zero-Shot Planners: Extracting Actionable Knowledge for Embodied Agents"
Stars: ✭ 84 (+37.7%)
Mutual labels:  codex
zsh codex
This is a ZSH plugin that enables you to use OpenAI's Codex AI in the command line.
Stars: ✭ 787 (+1190.16%)
Mutual labels:  codex
fix
Allows you to use OpenAI Codex to fix errors in the command line.
Stars: ✭ 72 (+18.03%)
Mutual labels:  codex
vim codex
This is a simple plugin for Vim that allows you to use OpenAI Codex.
Stars: ✭ 181 (+196.72%)
Mutual labels:  codex
warning
Warning Tool for CodeX Editor 2.0
Stars: ✭ 15 (-75.41%)
Mutual labels:  codex
capella
Cloud service for image storage and delivery
Stars: ✭ 116 (+90.16%)
Mutual labels:  codex
Codex
A free note-taking software for programmers and Computer Science students
Stars: ✭ 242 (+296.72%)
Mutual labels:  codex
awesome-codex
A list dedicated to products, demos and articles related to 🤖 OpenAI's Codex.
Stars: ✭ 115 (+88.52%)
Mutual labels:  codex
Editor.js
A block-styled editor with clean JSON output
Stars: ✭ 17,061 (+27868.85%)
Mutual labels:  codex-editor
codex.notes
WIP: crossplatform desktop notes application based on Electron and Editor.js
Stars: ✭ 102 (+67.21%)
Mutual labels:  codex-editor
editorjs-layout
Layout block tool for Editor.js.
Stars: ✭ 45 (-26.23%)
Mutual labels:  codex-editor

Link Tool

Link Block for the Editor.js.

Features

Allows adding link previews to your articles.

Note: this Tool requires server-side implementation for link data fetching. See backend response format for more details.

Installation

Install via NPM

Get the package

npm i --save-dev @editorjs/link

Include module at your application

const LinkTool = require('@editorjs/link');

Download to your project's source dir

  1. Download folder dist from repository
  2. Add dist/bundle.js file to your page.

Load from CDN

You can load the specific version of a package from jsDelivr CDN.

https://cdn.jsdelivr.net/npm/@editorjs/[email protected]

Then require this script on page with Editor.js through the <script src=""></script> tag.

Usage

Add a new Tool to the tools property of the Editor.js initial config.

const editor = EditorJS({
  ...

  tools: {
    ...
    linkTool: {
      class: LinkTool,
      config: {
        endpoint: 'http://localhost:8008/fetchUrl', // Your backend endpoint for url data fetching,
      }
    }
  },

  ...
});

Config Params

Link Tool supports these configuration parameters:

Field Type Description
endpoint string Required: the endpoint for link data fetching.
headers object Optional: the headers used in the GET request.

Output data

This Tool returns data with following format

Field Type Description
link string Pasted link's url
meta object Fetched link's data. Any data got from the backend. Currently, the plugin's design supports the 'title', 'image', and 'description' fields.
{
    "type" : "linkTool",
    "data" : {
        "link" : "https://codex.so",
        "meta" : {
            "title" : "CodeX Team",
            "site_name" : "CodeX",
            "description" : "Club of web-development, design and marketing. We build team learning how to build full-valued projects on the world market.",
            "image" : {
                "url" : "https://codex.so/public/app/img/meta_img.png"
            }
        }
    }
}

Backend response format

You can implement a backend for link data fetching your own way. It is a specific and trivial task depending on your environment and stack.

Backend response should cover following format:

{
    "success" : 1,
    "link": "https://codex.so", // Optionally return a link to set the hyperlink URL
    "meta": {
        // ... any fields you want
    }
}

success — uploading status. 1 for successful, 0 for failed

link - Optional response parameter to override the URL provided

meta — link fetched data.

Currently, the plugin's design supports the 'title', 'image', and 'description' fields. They should have the following format in the response:

{
    "success" : 1,
    "meta": {
        "title" : "CodeX Team",
        "description" : "Club of web-development, design and marketing. We build team learning how to build full-valued projects on the world market.",
        "image" : {
            "url" : "https://codex.so/public/app/img/meta_img.png"
        }
    }
}

Also, it can contain any additional fields you want to store.

About CodeX

CodeX is a team of digital specialists around the world interested in building high-quality open source products on a global market. We are open for young people who want to constantly improve their skills and grow professionally with experiments in cutting-edge technologies.

🌐 Join 👋 Twitter Instagram
codex.so codex.so/join @codex_team @codex_team
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].