|
1 | | -<h1 align="center"><a href="https://markdownd2pdf.vercel.app/">Markdown2pdf</a></h1> |
| 1 | +<h1 align="center"><a href="https://markdownd2pdf.vercel.app/">Markdown2PDF</a></h1> |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | + <strong>An Impressive Markdown to PDF Converter - Privacy-First, Offline-Capable Web Application</strong> |
| 5 | +</p> |
| 6 | + |
| 7 | +<p align="center"> |
| 8 | + <img src="public/md2pdf.png" alt="Markdown2PDF Preview" /> |
| 9 | +</p> |
2 | 10 |
|
3 | | -> An Impressive Markdown to PDF Converter! |
4 | 11 | ```diff |
5 | 12 | - Online Option: Upload resume.md to an unknown server? |
6 | 13 | + Try the Offline Web Application instead! |
7 | 14 | ``` |
8 | | - |
9 | 15 |
|
| 16 | +<p align="center"> |
| 17 | + <a href="https://markdownd2pdf.vercel.app/">🚀 Live Demo</a> • |
| 18 | + <a href="#features">✨ Features</a> • |
| 19 | + <a href="#tech-stack">🛠 Tech Stack</a> • |
| 20 | + <a href="#installation">📦 Installation</a> |
| 21 | +</p> |
10 | 22 |
|
11 | | -### Try out the website : [markdown2pdf](https://markdownd2pdf.vercel.app/) |
| 23 | +--- |
12 | 24 |
|
13 | | -### Key Features (Use as Highlights) |
14 | | -* ✨ **Instant Conversion** - Real-time preview as you type |
15 | | -* 🎨 **GitHub Flavored Markdown** - Full GFM support with tables, code blocks, and syntax highlighting |
16 | | -* 📊 **Rich Content Support** - LaTeX math formulas & Mermaid diagrams |
17 | | -* 🔒 **Privacy-First** - All processing happens locally in your browser |
18 | | -* 💻 **Developer-Friendly** - Code syntax highlighting for 100+ languages |
19 | | -* 📱 **Responsive Design** - Works perfectly on desktop and mobile |
20 | | -* ⚡ **No Installation** - Pure web app, zero setup required |
| 25 | +## 📖 Overview |
21 | 26 |
|
22 | | -## 👉 How to Use |
23 | | -1. Click the button to select a `.md` file. |
24 | | -2. Edit your content in the left-hand panel. |
25 | | -3. Click the **Convert** button! |
26 | | -4. Choose 'Destination' as **Save as PDF**. |
27 | | -5. **Chrome is recommended for best results**. |
| 27 | +**Markdown2PDF** is a powerful, privacy-focused web application that converts Markdown files to beautifully formatted PDF documents entirely in your browser. No server uploads, no data tracking - just pure client-side conversion with real-time preview. |
| 28 | + |
| 29 | +### 🌐 Try it Live |
| 30 | +**[https://markdownd2pdf.vercel.app/](https://markdownd2pdf.vercel.app/)** |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +## ✨ Features |
| 35 | + |
| 36 | +### 🎯 Core Features |
| 37 | +- **📁 File Upload Support** - Open and load `.md` files directly from your computer |
| 38 | +- **✏️ Live Markdown Editor** - Real-time editing with syntax highlighting powered by CodeMirror |
| 39 | +- **👁️ Live Preview** - See your markdown rendered instantly as you type |
| 40 | +- **📄 PDF Export** - Convert your markdown to PDF with a single click using the browser's native print functionality |
| 41 | +- **💾 Save Markdown** - Save your edited markdown files with smart filename generation based on document headings |
| 42 | +- **🔒 Privacy First** - All processing happens locally in your browser - no server uploads required |
| 43 | +- **📱 Responsive Design** - Works seamlessly on desktop and mobile devices with adaptive layouts |
| 44 | + |
| 45 | +### 🎨 Advanced Formatting Support |
| 46 | +- **📊 Mermaid Diagrams** - Create flowcharts, sequence diagrams, and other visualizations |
| 47 | +- **🧮 Mathematical Equations** - Full KaTeX support for LaTeX math rendering |
| 48 | +- **📝 GitHub Flavored Markdown** - Tables, task lists, and extended markdown syntax |
| 49 | +- **🔔 GitHub-Style Alerts** - Support for NOTE, TIP, IMPORTANT, WARNING, and CAUTION alerts |
| 50 | +- **🎨 Code Syntax Highlighting** - Beautiful code blocks with language-specific highlighting |
| 51 | +- **🌙 Dark Mode Editor** - VSCode Dark theme for comfortable editing |
| 52 | + |
| 53 | +### 🖥️ User Experience |
| 54 | +- **⚡ Fast Performance** - Built with Vite for lightning-fast development and optimized production builds |
| 55 | +- **🎯 Smart File Naming** - Automatically generates filenames from document headings |
| 56 | +- **🌐 Print-Optimized** - Carefully crafted print styles for professional PDF output |
| 57 | +- **📂 Modern File Picker** - Native browser file system API support (Chrome/Edge) with fallback for other browsers |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## 🛠️ Tech Stack |
| 62 | + |
| 63 | +### **Framework & Build Tools** |
| 64 | +- **⚛️ [React 18.2](https://react.dev/)** - Modern UI library with hooks and context API |
| 65 | +- **⚡ [Vite 7.2](https://vitejs.dev/)** - Next-generation frontend build tool for blazing fast development |
| 66 | + |
| 67 | +### **Styling** |
| 68 | +- **🎨 [Tailwind CSS 3.4](https://tailwindcss.com/)** - Utility-first CSS framework for rapid UI development |
| 69 | +- **🔧 [PostCSS](https://postcss.org/)** - CSS processing with autoprefixer |
| 70 | + |
| 71 | +### **Markdown & Code Editing** |
| 72 | +- **📝 [CodeMirror 6](https://codemirror.net/)** - Powerful code editor component |
| 73 | + - `@uiw/react-codemirror` - React wrapper for CodeMirror |
| 74 | + - `@codemirror/lang-markdown` - Markdown language support with syntax highlighting |
| 75 | + - `@codemirror/language-data` - Language support for code blocks |
| 76 | + - `@uiw/codemirror-themes-all` - VSCode Dark theme and other editor themes |
28 | 77 |
|
29 | | -## 👨🔧 Tech Stack |
| 78 | +### **Markdown Rendering** |
| 79 | +- **📄 [@uiw/react-markdown-preview](https://uiwjs.github.io/react-markdown-preview/)** - React markdown preview component |
| 80 | +- **🧮 [KaTeX](https://katex.org/)** - Fast math typesetting library |
| 81 | + - `rehype-katex` - Rehype plugin for KaTeX math rendering |
| 82 | + - `remark-math` - Remark plugin for parsing math in markdown |
| 83 | +- **📊 [Mermaid 11.10](https://mermaid.js.org/)** - Diagram and flowchart rendering from text |
30 | 84 |
|
31 | | -This project is built with the following technologies: |
| 85 | +### **Development Tools** |
| 86 | +- **✅ [ESLint](https://eslint.org/)** - Code linting with React-specific rules |
| 87 | +- **💅 [Prettier](https://prettier.io/)** - Code formatting with Tailwind CSS plugin |
| 88 | +- **🔍 PropTypes** - Runtime type checking for React props |
32 | 89 |
|
33 | | -- [React](https://react.dev/) |
34 | | -- [Vite](https://vitejs.dev/) |
35 | | -- [Tailwind CSS](https://tailwindcss.com/) |
36 | | -- [UIW React CodeMirror](https://uiwjs.github.io/react-codemirror/) |
37 | | -- [UIW React Markdown Preview](https://github.com/uiwjs/react-markdown-preview) |
| 90 | +--- |
38 | 91 |
|
39 | | -## 🛠️ Installation Steps |
| 92 | +## 📦 Installation |
40 | 93 |
|
41 | | -1. Fork the repository on GitHub. |
42 | | -2. Clone your forked copy of the project |
| 94 | +### Prerequisites |
| 95 | +- **Node.js** (v16 or higher) |
| 96 | +- **npm** or **yarn** package manager |
| 97 | + |
| 98 | +### Setup Instructions |
| 99 | + |
| 100 | +1. **Fork the Repository** |
| 101 | + - Click the 'Fork' button on the top right of the GitHub page |
| 102 | + |
| 103 | +2. **Clone Your Fork** |
43 | 104 | ```bash |
44 | 105 | git clone https://github.com/<your-github-username>/md2pdf.git |
45 | | - ``` |
46 | | -3. Change the working directory |
47 | | - ```bash |
48 | 106 | cd md2pdf |
49 | 107 | ``` |
50 | | -4. Install dependencies |
| 108 | + |
| 109 | +3. **Install Dependencies** |
51 | 110 | ```bash |
52 | 111 | npm install |
53 | 112 | ``` |
54 | | -5. Run the app |
| 113 | + |
| 114 | +4. **Start Development Server** |
55 | 115 | ```bash |
56 | 116 | npm run dev |
57 | 117 | ``` |
58 | | - |
59 | | -## About Me |
60 | | -- Github: [@fazi-gondal](https://github.com/fazi-gondal) |
61 | | -- Project: markdown2pdf (Markdown to PDF Converter) |
| 118 | + The application will be available at `http://localhost:5173` |
| 119 | + |
| 120 | +5. **Build for Production** (Optional) |
| 121 | + ```bash |
| 122 | + npm run build |
| 123 | + ``` |
| 124 | + The optimized build will be in the `dist` directory |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +## 👉 How to Use |
| 129 | + |
| 130 | +1. **📁 Open a File** - Click the "Open" button to select a `.md` file from your computer |
| 131 | +2. **✏️ Edit Content** - Use the left panel to edit your markdown with syntax highlighting |
| 132 | +3. **👁️ Preview** - Watch the right panel update in real-time as you type |
| 133 | +4. **💾 Save** - Click "Save" to download your edited markdown (with smart filename generation) |
| 134 | +5. **🎉 Convert to PDF** - Click the "PDF" button and choose 'Destination' as **Save as PDF** |
| 135 | + |
| 136 | +> **💡 Pro Tip:** Chrome is recommended for the best PDF export results and native file picker support. |
| 137 | +
|
| 138 | +--- |
| 139 | + |
| 140 | +## 🏗️ Project Structure |
| 141 | + |
| 142 | +``` |
| 143 | +md2pdf-main/ |
| 144 | +├── src/ |
| 145 | +│ ├── components/ # React components |
| 146 | +│ │ ├── Header.jsx # App header with actions |
| 147 | +│ │ ├── MdEditorComponent.jsx # CodeMirror editor |
| 148 | +│ │ ├── MdPreviewComponent.jsx # Markdown preview |
| 149 | +│ │ ├── Mermaid.jsx # Mermaid diagram renderer |
| 150 | +│ │ ├── FileInput.jsx # File upload handler |
| 151 | +│ │ └── PreviewButton.jsx # Preview toggle (mobile) |
| 152 | +│ ├── context/ # React Context for state management |
| 153 | +│ ├── hooks/ # Custom React hooks |
| 154 | +│ ├── pages/ # Page components |
| 155 | +│ ├── utils/ # Utility functions |
| 156 | +│ ├── App.jsx # Main app component |
| 157 | +│ ├── main.jsx # App entry point |
| 158 | +│ └── global.css # Global styles |
| 159 | +├── public/ # Static assets |
| 160 | +├── index.html # HTML template |
| 161 | +├── tailwind.config.js # Tailwind configuration |
| 162 | +├── vite.config.js # Vite configuration |
| 163 | +└── package.json # Project dependencies |
| 164 | +``` |
| 165 | + |
| 166 | +--- |
| 167 | + |
| 168 | +## 🚀 Available Scripts |
| 169 | + |
| 170 | +| Command | Description | |
| 171 | +|---------|-------------| |
| 172 | +| `npm run dev` | Start development server with hot reload | |
| 173 | +| `npm run build` | Build optimized production bundle | |
| 174 | +| `npm run preview` | Preview production build locally | |
| 175 | +| `npm run lint` | Run ESLint to check code quality | |
| 176 | + |
| 177 | +--- |
| 178 | + |
| 179 | +## 🎯 Key Technologies Explained |
| 180 | + |
| 181 | +### Why React + Vite? |
| 182 | +- **React** provides a component-based architecture for building interactive UIs |
| 183 | +- **Vite** offers instant server start and lightning-fast Hot Module Replacement (HMR) |
| 184 | + |
| 185 | +### Why CodeMirror? |
| 186 | +- Professional-grade code editor with extensive customization |
| 187 | +- Excellent performance with large documents |
| 188 | +- Built-in markdown syntax support |
| 189 | + |
| 190 | +### Why Client-Side Only? |
| 191 | +- **Privacy** - Your documents never leave your browser |
| 192 | +- **Offline Capable** - Works without an internet connection (after initial load) |
| 193 | +- **Fast** - No server round trips needed |
| 194 | + |
| 195 | +--- |
| 196 | + |
| 197 | +## 🤝 Contributing |
| 198 | + |
| 199 | +Contributions are welcome! Feel free to: |
| 200 | +- 🐛 Report bugs |
| 201 | +- 💡 Suggest new features |
| 202 | +- 🔧 Submit pull requests |
| 203 | + |
| 204 | +--- |
| 205 | + |
| 206 | +## 👨💻 Author |
| 207 | + |
| 208 | +**Faizan Gondal** |
| 209 | +- GitHub: [@fazi-gondal](https://github.com/fazi-gondal) |
| 210 | +- Project: [Markdown2PDF](https://github.com/fazi-gondal/md2pdf) |
| 211 | + |
| 212 | +--- |
| 213 | + |
| 214 | +## 📄 License |
| 215 | + |
| 216 | +This project is licensed under the **[MIT License](LICENSE)** - feel free to use it for personal or commercial projects. |
| 217 | + |
| 218 | +--- |
| 219 | + |
| 220 | +<p align="center"> |
| 221 | + Made with ❤️ by <a href="https://github.com/fazi-gondal">Faizan Gondal</a> |
| 222 | +</p> |
62 | 223 |
|
63 | | -## LICENSE |
64 | | -This project is licensed under the [MIT License](LICENSE). |
| 224 | +<p align="center"> |
| 225 | + <strong>⭐ If you find this project useful, please consider giving it a star on GitHub! ⭐</strong> |
| 226 | +</p> |
0 commit comments