1.0.9 • Published 3 months ago
@stronglify13/editor v1.0.9
@stronglify13/editor
Introduction
@stronglify13/editor
is a package based on Editor.js that provides a predefined configuration with additional block and inline tools, making it easier to create rich text editors.
Requirements to set up the development environment
Before you start, make sure you meet the following requirements:
- Node.js (version v20.16.0)
- You can use nvm to install and manage Node.js versions.
- A
.nvmrc
file with the recommended version is included in the root of this project. - You can install the recommended version with the following command:
nvm install
- You can use the recommended version with the following command:
nvm use
- yarn installed
- Have an npm account if you want to publish the package and be part of the
@stronglify13
organization.
Installing dependencies
Clone the repository and run:
yarn
Generate a new version of the package
To generate a new version, follow these steps:
- Make sure all changes are committed in Git.
- Modify the version in
package.json
: Build the package:
npm run build && npx tsc
Verify that everything works correctly before publishing.
Publishing the package
Log in to npm if you haven't already:
npm login
Publish the package to npm:
npm publish --access public
Verify that the package has been published correctly by checking npmjs.com.
Exported functionalities
The package exports the following tools and functions:
Main function
newEditor(config: NewEditorUsage)
: Creates a new instance of the editor with the provided configurations.
Block tools
Paragraph
Header
List
Image
Code
RawHTML
Block settings
AlignmentTune
Inline tools
BoldInlineTool
ItalicInlineTool
UnderlineInlineTool
MarkerInlineTool
CodeInlineTool
HyperlinkInlineTool
IdClassStyleInlineTool
Additional utilities
parseEditorHTML
: Converts the editor's output to HTML.
Usage example
import { newEditor } from '@stronglify13/editor';
newEditor({
htmlContainerID: 'editor',
placeholder: 'Write something...',
autofocus: true,
});
Contributing
If you want to contribute, open an issue or send a pull request to the project's repository.
License
This package is under the MIT license.