Skip to content

Commit 3cd6cd5

Browse files
committed
version v0.0.1
1 parent 36a841c commit 3cd6cd5

16 files changed

+4551
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.vscode-test/
3+
*.vsix

.vscode-test.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@vscode/test-cli';
2+
3+
export default defineConfig({
4+
files: 'test/**/*.test.js',
5+
});

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"dbaeumer.vscode-eslint",
6+
"ms-vscode.extension-test-runner"
7+
]
8+
}

.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// A launch configuration that launches the extension inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
]
15+
}
16+
]
17+
}

.vscodeignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.vscode/**
2+
.vscode-test/**
3+
test/**
4+
.gitignore
5+
.yarnrc
6+
vsc-extension-quickstart.md
7+
**/jsconfig.json
8+
**/*.map
9+
**/eslint.config.mjs
10+
**/.vscode-test.*

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
3+
## [v0.0.1] 2025/11/02
4+
5+
- Initial release

README.md

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,86 @@
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.

eslint.config.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import globals from "globals";
2+
3+
export default [{
4+
files: ["**/*.js"],
5+
languageOptions: {
6+
globals: {
7+
...globals.commonjs,
8+
...globals.node,
9+
...globals.mocha,
10+
},
11+
12+
ecmaVersion: 2022,
13+
sourceType: "module",
14+
},
15+
16+
rules: {
17+
"no-const-assign": "warn",
18+
"no-this-before-super": "warn",
19+
"no-undef": "warn",
20+
"no-unreachable": "warn",
21+
"no-unused-vars": "warn",
22+
"constructor-super": "warn",
23+
"valid-typeof": "warn",
24+
},
25+
}];

images/html-view.png

36.4 KB
Loading

jsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"module": "Node16",
4+
"target": "ES2022",
5+
"checkJs": false, /* Typecheck .js files. */
6+
"lib": [
7+
"ES2022"
8+
]
9+
},
10+
"exclude": [
11+
"node_modules"
12+
]
13+
}

0 commit comments

Comments
 (0)