A beautiful, modern web-based markdown editor with real-time preview and powerful features.
- Real-time Preview - See your markdown rendered instantly as you type
- Modern UI - Clean, responsive design that works on all devices
- Slash Commands - Type
/to access quick insertion menu - Toolbar Shortcuts - Quick formatting buttons for common markdown syntax
- Keyboard Shortcuts - Power user shortcuts for faster editing
- Auto-save - Your work is automatically saved to browser storage
- File Operations - Save and load markdown files
- Export Options - Export your markdown as HTML
- Fullscreen Mode - Distraction-free writing experience
- Word Count - Track your document length
- Sample Content - Load example markdown to get started
- Open
index.htmlin your web browser - Start typing in the editor pane on the left
- See your markdown rendered in real-time on the right
- Use the toolbar buttons or keyboard shortcuts for formatting
- Try typing
/to access the slash command menu
Type / in the editor to open a dropdown menu with quick insertion options:
/text- Generate AI-powered text using Gemini API/image- Generate AI-powered images using Gemini API
- Type
/at the beginning of a line - Start typing to filter commands (e.g.,
/imshows image) - Use arrow keys to navigate
- Press Enter or click to insert
- Press Escape to cancel
When you select /text, a popup will appear where you can:
- Enter a prompt describing what you want to generate
- Press Enter or click "Generate" to send to Gemini API
- The AI-generated text will be inserted into your document
- The popup includes loading states and error handling
When you select /image, a popup will appear where you can:
- Enter a prompt describing the image you want to generate
- Press Enter or click "Generate Image" to send to Gemini API
- The AI-generated image will be inserted as markdown with a data URL
- The image appears directly in your document and preview
Note: Both AI features use the Google Gemini API to generate content based on your prompts. Image generation uses the gemini-2.0-flash-preview-image-generation model.
Ctrl/Cmd + S- Save fileCtrl/Cmd + O- Open fileCtrl/Cmd + B- Bold textCtrl/Cmd + I- Italic textTab- Indent (4 spaces)/- Open slash command menuArrow Keys- Navigate slash commandsEnter- Execute slash commandEscape- Close slash command menu
- Bold -
**text** - Italic -
*text* - Heading -
### Heading - List -
- Item - Link -
[text](url) - Image -
 - Code Block -
\``code```` - Inline Code -
`code` - Quote -
> text
- Save - Download as .md file
- Load - Open markdown file
- Clear - Clear editor content
- Export HTML - Export as standalone HTML file
- Sample Content - Load example markdown
- Headers -
# H1,## H2,### H3, etc. - Emphasis -
**bold**,*italic*,~~strikethrough~~ - Lists -
- unordered,1. ordered - Links -
[text](url) - Images -
 - Code -
`inline`and\``blocks```` - Blockquotes -
> text - Tables - Standard markdown table syntax
- Horizontal Rules -
---
Works in all modern browsers:
- Chrome/Chromium
- Firefox
- Safari
- Edge
The editor automatically saves your content to browser localStorage every 30 seconds. Content is restored when you reload the page (if less than 24 hours old).
markdown-editor/
├── index.html # Main HTML file
├── styles.css # CSS styling
├── script.js # JavaScript functionality
└── README.md # This file
The editor uses CDN-hosted libraries:
- Marked.js - Markdown parsing
- DOMPurify - HTML sanitization
- Font Awesome - Icons
- Google Gemini API - AI text generation
You can easily customize the editor by modifying:
styles.css- Change colors, fonts, and layoutscript.js- Add new features or modify behaviorindex.html- Adjust the interface structure
This project is open source and available under the MIT License.
Happy writing! ✍️
