Skip to content

Getting Started

perpil edited this page Aug 29, 2022 · 90 revisions

Installation

  1. Install Tampermonkey if you don't already have it.
  2. Install Speedrun
  3. Reload this page

See some examples

Learn the basics

Using a template

A template reduces the amount of code you need to write to do something. Surround your content with code fences, put the #template you want to use on a new line and enter your content. This will use the copy template to copy something to the clipboard.

#copy
This was copied by ${user}

Prompting for inputs

To prompt the user to enter something, surround what you want to prompt the user for with 3 tildes.

#copy
This is ${user}'s favorite color: ~~~Favorite Color~~~

Running Javascript

To use Javascript wrap content with ${}

#copy
This is ${user.toUpperCase()}'s favorite color: ~~~Favorite Color~~~

Getting Credentials

Hold on champ, first you need to configure credentials.

Using it with AWS credentials

Create Speedrun Roles

Follow this wiki to create the necessary Speedrun roles and to register your AWS account

Install srinit

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

How it works

Speedrun takes a template that defines what you want it to do, populates it and runs it using the web browser. It can use any of the following to do what you need to do.

  1. 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, prompts and javascript code.
  2. 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.
  3. Credentials
  4. 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.
  5. Javascript Javascript is used to manipulate inputs, reference configuration and set default values.

Speedrun does the following when you load a wiki page.

  1. Find all configuration for current page, and uses it to build the toolbar
  2. Look for code fences that use a defined template and add buttons to them, and render a preview.
  3. When the button is clicked on, prompt for any inputs, resolve any variables, and run all javascript code to process the template.
  4. 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.

Clone this wiki locally