Whatever happened to just writing it all out on the document?
A modern, responsive markdown editor application built with React, TypeScript, and Vite. This application allows users to create, edit, and preview markdown documents with a clean, intuitive interface.
- Document Management: Create, read, update, and delete markdown documents
- Real-time Preview: See your markdown rendered in real-time as you type
- Split View: Edit and preview your markdown side by side
- Full Preview Mode: Toggle to a full-screen preview of your document
- Dark/Light Mode: Switch between dark and light themes
- Responsive Design: Works on desktop and mobile devices
- Persistent Storage: Documents are saved to localStorage
- React: UI library for building the interface
- TypeScript: Type-safe JavaScript
- Vite: Fast, modern build tool
- Tailwind CSS: Utility-first CSS framework for styling
- Marked: Markdown parser and compiler
- DOMPurify: HTML sanitizer for security
- Lucide React: Icon library
- Node.js (v16 or later)
- npm or pnpm
-
Clone the repository
git clone https://github.com/bittricky/markdown-editor.git cd markdown-editor -
Install dependencies
npm install # or pnpm install -
Start the development server
npm run dev # or pnpm run dev -
Open your browser and navigate to
http://localhost:5173
npm run build
# or
pnpm run buildThe built files will be in the dist directory.
- App.tsx: Main application component that manages global state and layout
- Header.tsx: Contains the application header with document name, save button, and theme toggle
- Sidebar.tsx: Displays a list of documents and provides document management functionality
- Editor.tsx: The markdown editor and preview component
The application uses React's built-in state management with hooks:
- useDocument: Custom hook for document CRUD operations
- useLocalStorage: Custom hook for persisting data to localStorage
The application supports both light and dark themes using Tailwind CSS's dark mode. Theme preferences are stored and persisted between sessions.