|
1 | | -# html-view |
2 | | - View and preview HTML files inside VS Code. |
| 1 | +## 🖥️ **HTML View - VS Code Extension** |
| 2 | +📄 **Preview and View HTML files inside VS Code with ease!** |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | +### 🔥 **Features** |
| 7 | +✅ **Live HTML Preview** in a WebView panel |
| 8 | +✅ **Supports Linked CSS & JS Files** |
| 9 | +✅ **Handles Internal Links (`#about`) Correctly** |
| 10 | +✅ **Opens External Links in Browser** |
| 11 | +✅ **Supports `CTRL + ALT + V` Shortcut for Quick Preview** |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +### 🚀 **Installation** |
| 16 | +#### **From VS Code Marketplace** |
| 17 | +1. Open **VS Code** |
| 18 | +2. Go to **Extensions** (`Ctrl + Shift + X`) |
| 19 | +3. Search for `"HTML View"` |
| 20 | +4. Click **Install** |
| 21 | + |
| 22 | +#### **Manual Installation** |
| 23 | +1. Download the `.vsix` file from [Releases](https://github.com/NSTechBytes/html-view/releases) |
| 24 | +2. Open VS Code and go to `Extensions` → Click `...` → `Install from VSIX` |
| 25 | +3. Select the downloaded `.vsix` file |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +### 🎯 **Usage** |
| 30 | +#### **Method 1: Command Palette** |
| 31 | +1. Open an HTML file in VS Code |
| 32 | +2. Press `Ctrl + Shift + P` |
| 33 | +3. Type `"Preview HTML"` and press **Enter** |
| 34 | + |
| 35 | +#### **Method 2: Keyboard Shortcut** |
| 36 | +- Press `Ctrl + Alt + V` to instantly preview the current HTML file |
| 37 | + |
| 38 | +--- |
| 39 | + |
| 40 | +### ⚙️ **How It Works** |
| 41 | +- The extension **creates a WebView panel** to render HTML files |
| 42 | +- It **ensures that internal fragment links (`#about`) stay inside the WebView** |
| 43 | +- **External links (`https://example.com`) open in your default browser** |
| 44 | +- It **resolves relative paths for CSS/JS files** automatically |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +### 📌 **Keybindings** |
| 49 | +| Command | Description | Shortcut | |
| 50 | +|-------------------|-------------------|--------------| |
| 51 | +| `htmlView.preview` | Open HTML Preview | `Ctrl + Alt + V` | |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +### 🛠️ **Development** |
| 56 | +#### **Clone & Run Locally** |
| 57 | +```sh |
| 58 | +git clone https://github.com/NSTechBytes/html-view.git |
| 59 | +cd html-view |
| 60 | +npm install |
| 61 | +``` |
| 62 | +#### **Run in VS Code** |
| 63 | +1. Open the project in VS Code |
| 64 | +2. Press `F5` to start a new VS Code instance with the extension loaded |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +### 🐛 **Bug Reports & Suggestions** |
| 69 | +Found a bug? Have an idea? |
| 70 | +👉 **[Create an Issue](https://github.com/NSTechBytes/html-view/issues)** |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +### ❤️ **Support** |
| 75 | +If you like this extension, consider ⭐ starring the repo! |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +### 🏆 **Author** |
| 80 | +**Nasir Shahbaz** |
| 81 | +🔗 [GitHub](https://github.com/NSTechBytes) | [Website](https://nstechbytes.pages.dev/) |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +### 📜 **License** |
| 86 | +Apache 2.0 License. See [LICENSE](LICENSE) for details. |
0 commit comments