1.0.9 • Published 7 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
.nvmrcfile 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
@stronglify13organization.
Installing dependencies
Clone the repository and run:
yarnGenerate 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 tscVerify that everything works correctly before publishing.
Publishing the package
Log in to npm if you haven't already:
npm loginPublish the package to npm:
npm publish --access publicVerify 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
ParagraphHeaderListImageCodeRawHTML
Block settings
AlignmentTune
Inline tools
BoldInlineToolItalicInlineToolUnderlineInlineToolMarkerInlineToolCodeInlineToolHyperlinkInlineToolIdClassStyleInlineTool
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.