sterment
v1.0.0
Published
Build a lightweight markdown editor component that can be easily integrated into web applications. It should support features like live preview, syntax highlighting, and the ability to export the markdown content to HTML.
Downloads
3
Readme
Markdown Editor
Markdown Editor is a lightweight JavaScript library for integrating a simple Markdown editor into your web applications.
Features
- Basic Markdown Editing: Easily write and edit Markdown text.
- Live Preview: See a live preview of the rendered HTML as you type.
- Text Formatting: Format text with bold, italic, and links.
Installation
Install the Markdown Editor package from npm:
npm install markdown-editor
Usage
const editor = new MarkdownEditor('textarea-id');
Replace 'textarea-id'
with the ID of your textarea element where you want to integrate the Markdown editor.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Markdown Editor Example</title>
<link rel="stylesheet" href="markdown-editor.css">
</head>
<body>
<textarea id="editor"></textarea>
<script src="markdown-editor.js"></script>
<script>
const editor = new MarkdownEditor('editor');
</script>
</body>
</html>
Dependencies
- marked: For rendering Markdown text into HTML.
License
This project is licensed under the MIT License - see the LICENSE file for details.