Skip to content

Commit

Permalink
resize icon and trim markup
Browse files Browse the repository at this point in the history
  • Loading branch information
NomarCub committed Jul 16, 2021
1 parent 1d0f769 commit 42df1f9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ VSCode can't open a workspace without a further confirmation dialog (that you ju
## Credits

Thank you to the makers of the [DEVONlink](https://github.com/ryanjamurphy/DEVONlink-obsidian) plugin, as it was a great starting point for working with ribbon icons in Obsidian.
I got the icon from [icon-icons.com](https://icon-icons.com/icon/visual-studio-code-logo/144754) and resized it with [iLoveIMG](https://www.iloveimg.com/resize-image/resize-svg).

## Support

Expand Down
8 changes: 4 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { addIcon, FileSystemAdapter, Plugin } from 'obsidian';

let svg = `
<svg width="100%" height="100%" viewBox="0 0 30 30" version="1.1" fill="currentColor"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
<path d="M30.865 3.448l-6.583-3.167c-0.766-0.37-1.677-0.214-2.276 0.385l-12.609 11.505-5.495-4.167c-0.51-0.391-1.229-0.359-1.703 0.073l-1.76 1.604c-0.583 0.526-0.583 1.443-0.005 1.969l4.766 4.349-4.766 4.349c-0.578 0.526-0.578 1.443 0.005 1.969l1.76 1.604c0.479 0.432 1.193 0.464 1.703 0.073l5.495-4.172 12.615 11.51c0.594 0.599 1.505 0.755 2.271 0.385l6.589-3.172c0.693-0.333 1.13-1.031 1.13-1.802v-21.495c0-0.766-0.443-1.469-1.135-1.802zM24.005 23.266l-9.573-7.266 9.573-7.266z"/>
</svg>`
<path
fill="currentColor"
d="M 96.453125 10.773438 L 75.882812 0.878906 C 73.488281 -0.277344 70.640625 0.210938 68.769531 2.082031 L 29.367188 38.035156 L 12.195312 25.011719 C 10.601562 23.789062 8.351562 23.890625 6.871094 25.242188 L 1.371094 30.253906 C -0.449219 31.898438 -0.449219 34.761719 1.355469 36.40625 L 16.25 49.996094 L 1.355469 63.585938 C -0.449219 65.230469 -0.449219 68.097656 1.371094 69.742188 L 6.871094 74.753906 C 8.367188 76.101562 10.601562 76.203125 12.195312 74.980469 L 29.367188 61.945312 L 68.789062 97.914062 C 70.644531 99.785156 73.492188 100.273438 75.882812 99.117188 L 96.476562 89.203125 C 98.640625 88.164062 100.007812 85.980469 100.007812 83.570312 L 100.007812 16.398438 C 100.007812 14.007812 98.621094 11.808594 96.460938 10.769531 Z M 75.015625 72.707031 L 45.101562 50 L 75.015625 27.292969 Z M 75.015625 72.707031"
/>`

addIcon('vscode-logo', svg);
export default class OpenVSCode extends Plugin {
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "open-vscode",
"name": "Open vault in VSCode",
"version": "1.0.0",
"version": "1.0.1",
"minAppVersion": "0.11.13",
"description": "Ribbon button and command to open vault as a Visual Studio Code workspace",
"author": "NomarCub",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "open-vscode",
"version": "1.0.0",
"version": "1.0.1",
"description": "Open vault in Visual Studio Code ribbon button and command for Obsidian (https://obsidian.md)",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit 42df1f9

Please sign in to comment.