diff --git a/src/excmds.ts b/src/excmds.ts index 3a2202ed..4572df15 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -442,12 +442,13 @@ export async function help(excmd?: string) { } /** Start the tutorial + * @param newtab - whether to start the tutorial in a newtab. Defaults to current tab. */ //#background -export async function tutor() { +export async function tutor(newtab?: string) { const tutor = browser.extension.getURL("static/clippy/tutor.html") - console.log(tutor) - open(tutor) + if (newtab) tabopen(tutor) + else open(tutor) } /** @hidden */ @@ -1922,15 +1923,8 @@ export async function bmark(url?: string, ...titlearr: string[]) { */ //#background_helper browser.runtime.onInstalled.addListener(details => { - if (details.reason == "install") tabopen() + if (details.reason == "install") tutor("newtab") // could add elif "update" and show a changelog. Hide it behind a setting to make it less annoying? - // const docpage = browser.extension.getURL("static/docs/modules/_excmds_.html#") - // if (excmd === undefined) excmd = "tridactyl-help-page" - // if ((await activeTab()).url.startsWith(docpage)) { - // open(docpage + excmd) - // } else { - // tabopen(docpage + excmd) - // } }) // vim: tabstop=4 shiftwidth=4 expandtab diff --git a/src/static/clippy/tutor.md b/src/static/clippy/tutor.md index fe3560e1..6ff66e6b 100644 --- a/src/static/clippy/tutor.md +++ b/src/static/clippy/tutor.md @@ -1,6 +1,6 @@ # Tridactyl tutorial -Hello. +Hello. If you've just installed Tridactyl for the first time, welcome! Tridactyl has something of a learning cliff. If you haven't used an add-on like it before, such as Pentadactyl or Vimperator, we strongly recommend you spend the 10-15 minutes it will take you to read through this tutorial. If you're already familiar with add-ons like this, we still suggest you skim through everything as there are a few things we do differently. Without further ado: Welcome to the Tridactyl tutorial. Here, you will learn how to get started with this extension. If you ever want to get back to this page, just type `:tutor`.