From 42ddd9aad44a4d8078139fea5df1113544db1ff0 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 7 Jan 2025 11:51:59 +0100 Subject: [PATCH 1/3] Add docs actions --- CHANGELOG.md | 4 ++++ assets/demo-time-logo.woff | Bin 0 -> 1536 bytes package.json | 20 ++++++++++++++++++++ src/constants/Command.ts | 2 ++ src/services/DemoCreator.ts | 8 ++++++++ 5 files changed, 34 insertions(+) create mode 100644 assets/demo-time-logo.woff diff --git a/CHANGELOG.md b/CHANGELOG.md index a0616b6..70f9a33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [0.0.51] - 2025-01-07 + +- Add open documentation action and link it to the editor title for JSON files + ## [0.0.50] - 2025-01-06 - [#23](https://github.com/estruyf/vscode-demo-time/issues/23): Add the ability to add notes to demos diff --git a/assets/demo-time-logo.woff b/assets/demo-time-logo.woff new file mode 100644 index 0000000000000000000000000000000000000000..2eac9d1b3da8d52c344e8042cb12acaec832ab95 GIT binary patch literal 1536 zcma)6O>7%Q6n?X__Qvbf>$YAyanjA&acs*@oi_eSThgj3)ru5Vfr26^rF88qPLS=5 z97iM-TsVNl1r9|h2QG*+;y`X3azOOb1Giq0dZ~oO2_z&S=9}GZ6hV*}&wKN|Z{E+$ z&Wzt(wk%?V7AA^{G4!p_$F=2G=H`jm24{{@VCdEP#=;fm_j)Z~sIWqy@>#`q5jvR=k$w+ng_qy+wFNKU zSIHF9tN+MWVbcYDMz8ACdbOU>6|btE6pJXcdUZa@9$soR?&kC9iShA?Z0CBd`CRUz znaYh@-E2A)i$zO`Gr8%PXUlVmrPCYp&EjZTohm7^tdyqI@@TPH)vxI_`;ZQ6v9pGe zE52EaUeFG{cw;G_%oax^rk#vV#8defZZqrlojV7=?5d|^Nn)}RF|wKI(+U1S(G%Co z56xV+u=3Dd3O~TPc;7cStidED&)`jwg@}4RlGri{`4Y3^cms)pgqg% z8G(w?*Fj!J3OIkY67anMbKpjRW#Fv|6rjNxNkRxDXnDMa$+zv1Y zz8qi~_`Lv!C`o33!{BcPSfv_$wcc{OuG^z^YLQD_h)cZ{r@y)G_RRB@bF@MZ^=T6h zm_VNMRH1XnMjcDua@t!RyN{v{7P>_pJhlF@o|fAim~E%$^zDJOYBqPwrIvdWYpamu l)gGXF8)@{5R~j+q(b& literal 0 HcmV?d00001 diff --git a/package.json b/package.json index bc0badf..d403c0a 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,13 @@ "fontPath": "assets/demo-time-v1.woff", "fontCharacter": "\\e900" } + }, + "dt-logo": { + "description": "Demo Time - logo", + "default": { + "fontPath": "assets/demo-time-logo.woff", + "fontCharacter": "\\e800" + } } }, "configuration": { @@ -138,6 +145,12 @@ } }, "commands": [ + { + "command": "demo-time.docs", + "title": "Open Demo Time documentation", + "category": "Demo Time", + "icon": "$(dt-logo)" + }, { "command": "demo-time.start", "title": "Start", @@ -333,6 +346,13 @@ "when": "view == demo-time && (viewItem =~ /demo-time.hasNotes/)", "group": "inline@4" } + ], + "editor/title": [ + { + "command": "demo-time.docs", + "when": "(editorLangId == jsonc || editorLangId == json) && resourceDirname =~ /\\.demo$/", + "group": "navigation@1" + } ] }, "views": { diff --git a/src/constants/Command.ts b/src/constants/Command.ts index 8919e10..5e1ac7f 100644 --- a/src/constants/Command.ts +++ b/src/constants/Command.ts @@ -1,6 +1,8 @@ export const EXTENSION_NAME = "demo-time"; export const COMMAND = { + // Documentation + documentation: `${EXTENSION_NAME}.docs`, // Running the demo start: `${EXTENSION_NAME}.start`, previous: `${EXTENSION_NAME}.previous`, diff --git a/src/services/DemoCreator.ts b/src/services/DemoCreator.ts index 7527f79..c27cee6 100644 --- a/src/services/DemoCreator.ts +++ b/src/services/DemoCreator.ts @@ -15,6 +15,7 @@ export class DemoCreator { public static registerCommands() { const subscriptions: Subscription[] = Extension.getInstance().subscriptions; + subscriptions.push(commands.registerCommand(COMMAND.documentation, DemoCreator.documentation)); subscriptions.push(commands.registerCommand(COMMAND.initialize, DemoCreator.initialize)); subscriptions.push(commands.registerCommand(COMMAND.openDemoFile, DemoCreator.openFile)); subscriptions.push(commands.registerCommand(COMMAND.addToStep, DemoCreator.addToStep)); @@ -29,6 +30,13 @@ export class DemoCreator { ); } + /** + * Opens the documentation page in the browser. + */ + private static documentation() { + commands.executeCommand("vscode.open", Uri.parse("https://demotime.elio.dev/getting-started/")); + } + /** * Initializes the demo by getting the demo files, creating a file if none exists, * and showing the text document. It also updates the demo panel and displays an From 5ba9b6687c4a9beca5fed31679a496c9b4076863 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 7 Jan 2025 11:52:07 +0100 Subject: [PATCH 2/3] 0.0.51 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4fa144c..001c4c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-demo-time", - "version": "0.0.50", + "version": "0.0.51", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vscode-demo-time", - "version": "0.0.50", + "version": "0.0.51", "license": "MIT", "devDependencies": { "@estruyf/vscode": "^1.1.0", diff --git a/package.json b/package.json index d403c0a..f2fb9fc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-demo-time", "displayName": "Demo Time", "description": "Script your coding demos to perfection with this VS Code extension – no typos, no missteps, just flawless, stress-free presentations every time. Execute each demo step seamlessly, just like advancing through a slide presentation!", - "version": "0.0.50", + "version": "0.0.51", "publisher": "eliostruyf", "galleryBanner": { "color": "#86836D", From 5ed6e0fe450f310e820d1046abc3c95696536610 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 7 Jan 2025 11:52:16 +0100 Subject: [PATCH 3/3] #release