-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
- Install Tampermonkey if you don't already have it.
- Install Speedrun
- Reload this page
Get a taste for the power on the demo page.
Each Speedrun block starts with the name of a template which tells Speedrun what to do and reduces the amount of code you need to write. The most basic template is the copy template which copies something to the clipboard. To get Speedrun to find and wire up your code, wrap your content with code fences (```), put the #template you want to use on a new line and enter any content below that.
💡 Tip Click the Code tab to see the underlying Markdown for an entry. Click the
icon to copy the underlying Markdown to the clipboard.
This will use the copy template to copy something to the clipboard.
#copy
This was copied by ${user}
Read more about templates, the different template types and how to build your own here.
To prompt the user, wrap the prompt name with 3 tildes (~~~) on each side. Speedrun will replace it with what the user enters.
#copy
This is ${user}'s favorite color: ~~~Favorite Color~~~
Read more about prompts, changing the prompt type, default values and transforming inputs here.
To use JavaScript wrap content with ${}
#copy
This is ${user.toUpperCase()}'s favorite color: ~~~Favorite Color~~~
Read more about using Javascript, helper functions and defining your own functions here.
Find out how to use the toolbar and the interface here: User Interface Documentation
Speedrun configuration is used to define the services and regions that appear in the toolbar. It is also sets variables used in the page context. Read about it here
Hold on champ, first you need to configure your accounts and roles.
Follow this wiki to create the necessary Speedrun roles and to register your AWS account
srinit is a command line tool that authenticates you with GitHub so you can assume speedrun roles you have permissions to
#copy
python3 -m pip install --extra-index-url https://speedrun.nobackspacecrew.com/packages srinit
Now run srinit to authenticate so you can run AWS CLI commands. This needs to be done once per day.
#copy
srinit
If you've added your account and role to the settings, you can now use them.
#federate
If you have the AWS CLI installed, you can run commands with credentials like this.
#copy.withCreds
aws sts get-caller-identity
Speedrun takes a template that defines what you want it to do, sets the variables from the context and evaluates the JavaScript in the browser. It can use any of the following to do what you need to do.
- Wiki content Wiki content, referenced by ${content} is what you put in your code fence. It can be any text content including things like json, a url, a command line or JavaScript code.
- Prompts Prompts prompt the user for input. By default, they are set to what was entered last time the user was prompted for the same thing.
-
Credentials Speedrun operates as a credentials broker, if the authenticated GitHub user is authorized to assume the role (specified by the
rolevariable) in the account (specified by theaccountvariable), it can get the necessary credentials to federate into the AWS Console or get credentials for the command line. - Configuration Configuration defines things like what AWS accounts and roles to use, what your services are called and any configuration you want to associate with your services like the log groups they use, or the stage.
- JavaScript JavaScript is used to manipulate inputs, reference configuration and set default values.
Speedrun does the following when you load a wiki page.
- Finds all the configuration for current page and uses it to build the toolbar
- Looks for code fences that use a defined template, adds buttons to them and renders a preview.
- When the do it button is clicked; prompt for any inputs, resolve any variables, and run all JavaScript code to process the template.
- Depending on the template type, copy the result to the clipboard, open a link, federate into the AWS Console or download the result as a file.