jupyterlab_vscode_icons_extension 1.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +29 -0
- package/README.md +84 -0
- package/lib/icons.d.ts +31 -0
- package/lib/icons.js +213 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +666 -0
- package/package.json +196 -0
- package/src/__tests__/jupyterlab_vscode_icons_extension.spec.ts +9 -0
- package/src/icons.ts +244 -0
- package/src/index.ts +752 -0
- package/style/base.css +45 -0
- package/style/index.css +1 -0
- package/style/index.js +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Stellars Henson
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# JupyterLab VSCode Icons Extension
|
|
2
|
+
|
|
3
|
+
[](https://github.com/stellarshenson/jupyterlab_vscode_icons_extension/actions/workflows/build.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/jupyterlab_vscode_icons_extension)
|
|
5
|
+
[](https://pypi.org/project/jupyterlab-vscode-icons-extension/)
|
|
6
|
+
[](https://pepy.tech/project/jupyterlab-vscode-icons-extension)
|
|
7
|
+
[](https://jupyterlab.readthedocs.io/en/stable/)
|
|
8
|
+
[](https://kolomolo.com)
|
|
9
|
+
|
|
10
|
+
A shameless, unapologetic, and utterly brazen ripoff of the excellent VSCode file icons for JupyterLab. Because why should VS Code users have all the fun?
|
|
11
|
+
|
|
12
|
+
This extension brings 1414 beautiful file type icons from the vscode-icons project directly into your JupyterLab file browser. We saw those pretty icons, we wanted them, and now you can have them too - no permission asked, no apologies given (well, we did use the MIT license, so it's all legally kosher)
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
- 1414 file type icons covering virtually every language, framework, and config file you can think of
|
|
19
|
+
- Automatic icon detection based on file extensions and names
|
|
20
|
+
- Zero configuration required - just install and enjoy
|
|
21
|
+
- Lightweight integration using Iconify's JSON icon format
|
|
22
|
+
- Compatible with Jupytext - properly displays Python and Markdown icons for .py and .md notebook files
|
|
23
|
+
- No folders (we left those alone... for now)
|
|
24
|
+
|
|
25
|
+
## Requirements
|
|
26
|
+
|
|
27
|
+
- JupyterLab 4.0+
|
|
28
|
+
- A sense of humor about intellectual property (kidding - it's MIT licensed)
|
|
29
|
+
- Appreciation for pretty icons
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install jupyterlab_vscode_icons_extension
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
That's it. Restart JupyterLab and watch your bland, iconless file browser transform into a colorful, VSCode-inspired masterpiece
|
|
38
|
+
|
|
39
|
+
## Supported File Types
|
|
40
|
+
|
|
41
|
+
The extension recognizes hundreds of file types including:
|
|
42
|
+
|
|
43
|
+
- **Languages**: Python, JavaScript, TypeScript, Java, C/C++, Rust, Go, Ruby, PHP, R, Julia, and many more
|
|
44
|
+
- **Web**: HTML, CSS, SCSS, Vue, Svelte, React components
|
|
45
|
+
- **Data**: JSON, YAML, CSV, XML, TOML
|
|
46
|
+
- **Documentation**: Markdown, RST, PDF
|
|
47
|
+
- **Config**: Dockerfile, .gitignore, .env, Makefile, package.json
|
|
48
|
+
- **Notebooks**: Jupyter notebooks (.ipynb)
|
|
49
|
+
|
|
50
|
+
For the complete list of 1414 icons, see the [vscode-icons project](https://github.com/vscode-icons/vscode-icons)
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
Customize which icon groups to display via JupyterLab Settings:
|
|
55
|
+
|
|
56
|
+
1. Open JupyterLab Settings (Settings -> Settings Editor)
|
|
57
|
+
2. Search for "VSCode Icons"
|
|
58
|
+
3. Toggle icon groups on/off:
|
|
59
|
+
- Programming Language Icons (Python, JS, TS, Java, C++, Rust, Go, etc.)
|
|
60
|
+
- Web Development Icons (HTML, CSS, Vue, Svelte)
|
|
61
|
+
- Data Format Icons (JSON, YAML, CSV, XML)
|
|
62
|
+
- Configuration File Icons (Dockerfile, .gitignore, Makefile, package.json)
|
|
63
|
+
- Documentation Icons (Markdown, RST, PDF)
|
|
64
|
+
- Image File Icons (PNG, JPG, SVG)
|
|
65
|
+
|
|
66
|
+
Changes require a page refresh to take effect.
|
|
67
|
+
|
|
68
|
+
## Uninstallation
|
|
69
|
+
|
|
70
|
+
If you somehow tire of beautiful icons (we can't imagine why):
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pip uninstall jupyterlab_vscode_icons_extension
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Credits
|
|
77
|
+
|
|
78
|
+
This extension shamelessly borrows icons from the excellent [vscode-icons](https://github.com/vscode-icons/vscode-icons) project by Roberto Huertas. Icons are delivered via [Iconify](https://iconify.design/), because we believe in standing on the shoulders of giants.
|
|
79
|
+
|
|
80
|
+
All icon assets remain under their original licenses (MIT for code, CC BY-SA for branded icons). We just wrapped them in a JupyterLab extension and called it a day.
|
|
81
|
+
|
|
82
|
+
## Why This Exists
|
|
83
|
+
|
|
84
|
+
Because JupyterLab deserves pretty icons too. That's it. That's the whole justification
|
package/lib/icons.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon mappings for file extensions using vscode-icons
|
|
3
|
+
*/
|
|
4
|
+
interface IIconMapping {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Map file extensions to vscode icon names
|
|
9
|
+
* Based on common file type associations
|
|
10
|
+
*/
|
|
11
|
+
export declare const extensionToIcon: IIconMapping;
|
|
12
|
+
/**
|
|
13
|
+
* Get icon name for a file
|
|
14
|
+
* @param filename - The file name
|
|
15
|
+
* @returns The icon name or default-file if not found
|
|
16
|
+
*/
|
|
17
|
+
export declare function getIconForFile(filename: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Get SVG content for an icon
|
|
20
|
+
* @param iconName - The icon name
|
|
21
|
+
* @returns The SVG body content
|
|
22
|
+
*/
|
|
23
|
+
export declare function getIconSVG(iconName: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Generate complete SVG element for an icon
|
|
26
|
+
* @param iconName - The icon name
|
|
27
|
+
* @param className - Optional CSS class name
|
|
28
|
+
* @returns Complete SVG string
|
|
29
|
+
*/
|
|
30
|
+
export declare function generateIconSVG(iconName: string, className?: string): string;
|
|
31
|
+
export {};
|
package/lib/icons.js
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon mappings for file extensions using vscode-icons
|
|
3
|
+
*/
|
|
4
|
+
import iconsData from '@iconify-json/vscode-icons/icons.json';
|
|
5
|
+
/**
|
|
6
|
+
* Map file extensions to vscode icon names
|
|
7
|
+
* Based on common file type associations
|
|
8
|
+
*/
|
|
9
|
+
export const extensionToIcon = {
|
|
10
|
+
// Programming languages
|
|
11
|
+
js: 'file-type-js-official',
|
|
12
|
+
jsx: 'file-type-reactjs',
|
|
13
|
+
ts: 'file-type-typescript-official',
|
|
14
|
+
tsx: 'file-type-reactts',
|
|
15
|
+
py: 'file-type-python',
|
|
16
|
+
pyc: 'file-type-python',
|
|
17
|
+
pyd: 'file-type-python',
|
|
18
|
+
pyo: 'file-type-python',
|
|
19
|
+
pyw: 'file-type-python',
|
|
20
|
+
pyx: 'file-type-cython',
|
|
21
|
+
ipynb: 'file-type-jupyter',
|
|
22
|
+
java: 'file-type-java',
|
|
23
|
+
class: 'file-type-class',
|
|
24
|
+
jar: 'file-type-jar',
|
|
25
|
+
c: 'file-type-c',
|
|
26
|
+
h: 'file-type-c',
|
|
27
|
+
cpp: 'file-type-cpp',
|
|
28
|
+
cc: 'file-type-cpp',
|
|
29
|
+
cxx: 'file-type-cpp',
|
|
30
|
+
hpp: 'file-type-hpp',
|
|
31
|
+
cs: 'file-type-csharp',
|
|
32
|
+
go: 'file-type-go',
|
|
33
|
+
rs: 'file-type-rust',
|
|
34
|
+
rb: 'file-type-ruby',
|
|
35
|
+
php: 'file-type-php',
|
|
36
|
+
swift: 'file-type-swift',
|
|
37
|
+
kt: 'file-type-kotlin',
|
|
38
|
+
kts: 'file-type-kotlin',
|
|
39
|
+
r: 'file-type-r',
|
|
40
|
+
R: 'file-type-r',
|
|
41
|
+
jl: 'file-type-julia',
|
|
42
|
+
scala: 'file-type-scala',
|
|
43
|
+
lua: 'file-type-lua',
|
|
44
|
+
pl: 'file-type-perl',
|
|
45
|
+
pm: 'file-type-perl',
|
|
46
|
+
sh: 'file-type-shell',
|
|
47
|
+
bash: 'file-type-shell',
|
|
48
|
+
zsh: 'file-type-shell',
|
|
49
|
+
fish: 'file-type-shell',
|
|
50
|
+
bat: 'file-type-shell',
|
|
51
|
+
cmd: 'file-type-shell',
|
|
52
|
+
ps1: 'file-type-powershell',
|
|
53
|
+
vbs: 'file-type-vba',
|
|
54
|
+
vbe: 'file-type-vba',
|
|
55
|
+
sql: 'file-type-sql',
|
|
56
|
+
// Web
|
|
57
|
+
html: 'file-type-html',
|
|
58
|
+
htm: 'file-type-html',
|
|
59
|
+
css: 'file-type-css',
|
|
60
|
+
scss: 'file-type-scss',
|
|
61
|
+
sass: 'file-type-sass',
|
|
62
|
+
less: 'file-type-less',
|
|
63
|
+
vue: 'file-type-vue',
|
|
64
|
+
svelte: 'file-type-svelte',
|
|
65
|
+
// Data formats
|
|
66
|
+
json: 'file-type-json',
|
|
67
|
+
yaml: 'file-type-yaml',
|
|
68
|
+
yml: 'file-type-yaml',
|
|
69
|
+
toml: 'file-type-toml',
|
|
70
|
+
xml: 'file-type-xml',
|
|
71
|
+
csv: 'file-type-csv',
|
|
72
|
+
tsv: 'file-type-csv',
|
|
73
|
+
// Documentation
|
|
74
|
+
md: 'file-type-markdown',
|
|
75
|
+
mdx: 'file-type-mdx',
|
|
76
|
+
rst: 'file-type-rst',
|
|
77
|
+
txt: 'file-type-text',
|
|
78
|
+
pdf: 'file-type-pdf',
|
|
79
|
+
// Config files
|
|
80
|
+
gitignore: 'file-type-git',
|
|
81
|
+
gitattributes: 'file-type-git',
|
|
82
|
+
gitmodules: 'file-type-git',
|
|
83
|
+
'.git': 'file-type-git',
|
|
84
|
+
'.gitignore': 'file-type-git',
|
|
85
|
+
'.gitattributes': 'file-type-git',
|
|
86
|
+
'.gitmodules': 'file-type-git',
|
|
87
|
+
dockerignore: 'file-type-docker',
|
|
88
|
+
dockerfile: 'file-type-docker',
|
|
89
|
+
env: 'file-type-dotenv',
|
|
90
|
+
ini: 'file-type-ini',
|
|
91
|
+
cfg: 'file-type-config',
|
|
92
|
+
conf: 'file-type-config',
|
|
93
|
+
// Package managers
|
|
94
|
+
'package.json': 'file-type-npm',
|
|
95
|
+
'package-lock.json': 'file-type-npm',
|
|
96
|
+
'yarn.lock': 'file-type-yarn',
|
|
97
|
+
'requirements.txt': 'file-type-python',
|
|
98
|
+
'pyproject.toml': 'file-type-python',
|
|
99
|
+
'setup.py': 'file-type-python',
|
|
100
|
+
Pipfile: 'file-type-python',
|
|
101
|
+
'Cargo.toml': 'file-type-rust',
|
|
102
|
+
'Cargo.lock': 'file-type-rust',
|
|
103
|
+
Gemfile: 'file-type-ruby',
|
|
104
|
+
'pom.xml': 'file-type-maven',
|
|
105
|
+
'build.gradle': 'file-type-gradle',
|
|
106
|
+
// Build tools
|
|
107
|
+
LICENSE: 'file-type-license',
|
|
108
|
+
LICENCE: 'file-type-license',
|
|
109
|
+
license: 'file-type-license',
|
|
110
|
+
licence: 'file-type-license',
|
|
111
|
+
webpack: 'file-type-webpack',
|
|
112
|
+
rollup: 'file-type-rollup',
|
|
113
|
+
vite: 'file-type-vite',
|
|
114
|
+
// CI/CD
|
|
115
|
+
'gitlab-ci.yml': 'file-type-gitlab',
|
|
116
|
+
'.travis.yml': 'file-type-travis',
|
|
117
|
+
'circle.yml': 'file-type-circleci',
|
|
118
|
+
Jenkinsfile: 'file-type-jenkins',
|
|
119
|
+
// Images
|
|
120
|
+
png: 'file-type-image',
|
|
121
|
+
jpg: 'file-type-image',
|
|
122
|
+
jpeg: 'file-type-image',
|
|
123
|
+
gif: 'file-type-image',
|
|
124
|
+
svg: 'file-type-svg',
|
|
125
|
+
ico: 'file-type-image',
|
|
126
|
+
webp: 'file-type-image',
|
|
127
|
+
bmp: 'file-type-image',
|
|
128
|
+
// Archives
|
|
129
|
+
zip: 'file-type-zip',
|
|
130
|
+
tar: 'file-type-zip',
|
|
131
|
+
gz: 'file-type-zip',
|
|
132
|
+
bz2: 'file-type-zip',
|
|
133
|
+
'7z': 'file-type-zip',
|
|
134
|
+
rar: 'file-type-zip',
|
|
135
|
+
// Windows specific
|
|
136
|
+
lnk: 'file-type-lnk',
|
|
137
|
+
// Other
|
|
138
|
+
lock: 'file-type-lock',
|
|
139
|
+
log: 'file-type-log',
|
|
140
|
+
wasm: 'file-type-wasm',
|
|
141
|
+
proto: 'file-type-protobuf',
|
|
142
|
+
graphql: 'file-type-graphql',
|
|
143
|
+
gql: 'file-type-graphql'
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Get icon name for a file
|
|
147
|
+
* @param filename - The file name
|
|
148
|
+
* @returns The icon name or default-file if not found
|
|
149
|
+
*/
|
|
150
|
+
export function getIconForFile(filename) {
|
|
151
|
+
const lowerFilename = filename.toLowerCase();
|
|
152
|
+
// Check exact filename matches first
|
|
153
|
+
if (extensionToIcon[lowerFilename]) {
|
|
154
|
+
return extensionToIcon[lowerFilename];
|
|
155
|
+
}
|
|
156
|
+
// Check for extension
|
|
157
|
+
const parts = filename.split('.');
|
|
158
|
+
if (parts.length > 1) {
|
|
159
|
+
const ext = parts[parts.length - 1].toLowerCase();
|
|
160
|
+
if (extensionToIcon[ext]) {
|
|
161
|
+
return extensionToIcon[ext];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// Check for special prefixes (dot files)
|
|
165
|
+
if (filename.startsWith('.')) {
|
|
166
|
+
const nameWithoutDot = filename.slice(1);
|
|
167
|
+
if (extensionToIcon[nameWithoutDot]) {
|
|
168
|
+
return extensionToIcon[nameWithoutDot];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return 'default-file';
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Get SVG content for an icon
|
|
175
|
+
* @param iconName - The icon name
|
|
176
|
+
* @returns The SVG body content
|
|
177
|
+
*/
|
|
178
|
+
export function getIconSVG(iconName) {
|
|
179
|
+
var _a, _b;
|
|
180
|
+
const icons = iconsData.icons;
|
|
181
|
+
const aliases = iconsData.aliases;
|
|
182
|
+
let icon;
|
|
183
|
+
// First check if it's an alias
|
|
184
|
+
const alias = aliases === null || aliases === void 0 ? void 0 : aliases[iconName];
|
|
185
|
+
if (alias === null || alias === void 0 ? void 0 : alias.parent) {
|
|
186
|
+
// Resolve alias to actual icon
|
|
187
|
+
icon = icons[alias.parent];
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
// Not an alias, check regular icons
|
|
191
|
+
icon = icons[iconName];
|
|
192
|
+
}
|
|
193
|
+
if (!icon) {
|
|
194
|
+
icon = icons['default-file'];
|
|
195
|
+
}
|
|
196
|
+
// Resolve parent reference if present
|
|
197
|
+
if (icon === null || icon === void 0 ? void 0 : icon.parent) {
|
|
198
|
+
const parentIcon = icons[icon.parent];
|
|
199
|
+
return (parentIcon === null || parentIcon === void 0 ? void 0 : parentIcon.body) || ((_a = icons['default-file']) === null || _a === void 0 ? void 0 : _a.body) || '';
|
|
200
|
+
}
|
|
201
|
+
return (icon === null || icon === void 0 ? void 0 : icon.body) || ((_b = icons['default-file']) === null || _b === void 0 ? void 0 : _b.body) || '';
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Generate complete SVG element for an icon
|
|
205
|
+
* @param iconName - The icon name
|
|
206
|
+
* @param className - Optional CSS class name
|
|
207
|
+
* @returns Complete SVG string
|
|
208
|
+
*/
|
|
209
|
+
export function generateIconSVG(iconName, className = '') {
|
|
210
|
+
const body = getIconSVG(iconName);
|
|
211
|
+
const classAttr = className ? ` class="${className}"` : '';
|
|
212
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"${classAttr}>${body}</svg>`;
|
|
213
|
+
}
|
package/lib/index.d.ts
ADDED