diff --git a/docs/docs/api_reference.md b/docs/docs/api_reference.md index 993591c0..a53b7cf6 100644 --- a/docs/docs/api_reference.md +++ b/docs/docs/api_reference.md @@ -11,7 +11,7 @@ toc_max_heading_level: 5 Task command line tool has the following syntax: -```bash +```shell task [--flags] [tasks...] [-- CLI_ARGS...] ``` diff --git a/docs/docs/faq.md b/docs/docs/faq.md index 0e809afb..6a8a96e6 100644 --- a/docs/docs/faq.md +++ b/docs/docs/faq.md @@ -69,7 +69,7 @@ tasks: - ./foo-printer.bash ``` -```bash +```shell #!/bin/bash a=foo echo $a diff --git a/docs/docs/installation.md b/docs/docs/installation.md index 2b666a9f..c9fc489e 100644 --- a/docs/docs/installation.md +++ b/docs/docs/installation.md @@ -14,7 +14,7 @@ Task offers many installation methods. Check out the available methods below. If you're on macOS or Linux and have [Homebrew][homebrew] installed, getting Task is as simple as running: -```bash +```shell brew install go-task/tap/go-task ``` @@ -25,24 +25,25 @@ Recently, Task was also made available [on the official Homebrew repository](https://formulae.brew.sh/formula/go-task), so you also have that option if you prefer: -```bash +```shell brew install go-task ``` ### Tea -If you're on macOS or Linux and have [tea][tea] installed, getting -Task is as simple as running: +If you're on macOS or Linux and have [tea][tea] installed, getting Task is as +simple as running: -```bash +```shell tea task ``` or, if you have tea’s magic enabled: -```bash +```shell task ``` + This installation method is community owned. After a new release of Task, they are automatically released by tea in a minimum of time. @@ -51,7 +52,7 @@ are automatically released by tea in a minimum of time. Task is available in [Snapcraft][snapcraft], but keep in mind that your Linux distribution should allow classic confinement for Snaps to Task work right: -```bash +```shell sudo snap install task --classic ``` @@ -60,7 +61,7 @@ sudo snap install task --classic If you're on Windows and have [Chocolatey][choco] installed, getting Task is as simple as running: -```bash +```shell choco install go-task ``` @@ -71,7 +72,7 @@ This installation method is community owned. If you're on Windows and have [Scoop][scoop] installed, getting Task is as simple as running: -```cmd +```shell scoop install task ``` @@ -84,7 +85,7 @@ If you're on Arch Linux you can install Task from [AUR](https://aur.archlinux.org/packages/go-task-bin) using your favorite package manager such as `yay`, `pacaur` or `yaourt`: -```cmd +```shell yay -S go-task-bin ``` @@ -93,7 +94,7 @@ Alternatively, there's the source code instead of downloading the binary from the [releases page](https://github.com/go-task/task/releases): -```cmd +```shell yay -S go-task ``` @@ -105,7 +106,7 @@ If you're on Fedora Linux you can install Task from the official [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/) repository using `dnf`: -```cmd +```shell sudo dnf install go-task ``` @@ -118,7 +119,7 @@ take some time until it's available in If you're on NixOS or have Nix installed you can install Task from [nixpkgs](https://github.com/NixOS/nixpkgs): -```cmd +```shell nix-env -iA nixpkgs.go-task ``` @@ -131,7 +132,7 @@ take some time until it's available in You can also use Node and npm to install Task by installing [this package](https://www.npmjs.com/package/@go-task/cli). -```bash +```shell npm install -g @go-task/cli ``` @@ -141,7 +142,7 @@ If you are using Windows and installed the [winget](https://github.com/microsoft/winget-cli) package management tool, you can install Task from [winget-pkgs](https://github.com/microsoft/winget-pkgs). -```bash +```shell winget install Task.Task ``` @@ -165,7 +166,7 @@ easy generation of this script. By default, it installs on the `./bin` directory relative to the working directory: -```bash +```shell sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d ``` @@ -173,7 +174,7 @@ It is possible to override the installation directory with the `-b` parameter. On Linux, common choices are `~/.local/bin` and `~/bin` to install for the current user or `/usr/local/bin` to install for all users: -```bash +```shell sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin ``` @@ -209,13 +210,13 @@ setup. You can find the minimum required version of Go in the You can then install the latest release globally by running: -```bash +```shell go install github.com/go-task/task/v3/cmd/task@latest ``` Or you can install into another directory: -```bash +```shell env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest ``` @@ -239,7 +240,7 @@ First, ensure that you installed bash-completion using your package manager. Make the completion file executable: -``` +```shell chmod +x path/to/task.bash ``` @@ -278,7 +279,7 @@ mv path/to/task.fish ~/.config/fish/completions/task.fish Open your profile script with: -``` +```powershell mkdir -Path (Split-Path -Parent $profile) -ErrorAction SilentlyContinue notepad $profile ``` diff --git a/docs/docs/usage.md b/docs/docs/usage.md index 3d386386..a8947517 100644 --- a/docs/docs/usage.md +++ b/docs/docs/usage.md @@ -27,7 +27,7 @@ tasks: Running the tasks is as simple as running: -```bash +```shell task assets build ``` @@ -162,11 +162,11 @@ variables, as you can see in the [Variables](#variables) section. You can also ask Task to include `.env` like files by using the `dotenv:` setting: -```bash title=".env" +```shell title=".env" KEYNAME=VALUE ``` -```bash title="testing/.env" +```shell title="testing/.env" ENDPOINT=testing.com ``` @@ -699,7 +699,7 @@ path like `tmp/task` that will be interpreted as relative to the project directory, or an absolute or home path like `/tmp/.task` or `~/.task` (subdirectories will be created for each project). -```bash +```shell export TASK_TEMP_DIR='~/.task' ``` @@ -950,7 +950,7 @@ listed below in order of importance (i.e. most important first): Example of sending parameters with environment variables: -```bash +```shell $ TASK_VARIABLE=a-value task do-something ``` @@ -964,7 +964,7 @@ Since some shells do not support the above syntax to set environment variables (Windows) tasks also accept a similar style when not at the beginning of the command. -```bash +```shell $ task write-file FILE=file.txt "CONTENT=Hello, World!" print "MESSAGE=All done!" ``` @@ -1192,7 +1192,7 @@ If `--` is given in the CLI, all following parameters are added to a special The below example will run `yarn install`. -```bash +```shell $ task yarn -- install ``` @@ -1400,7 +1400,7 @@ tasks: would print the following output: -```bash +```shell * build: Build the go binary. * test: Run all the go tests. ``` @@ -1533,7 +1533,7 @@ tasks: - echo 'dangerous command' ``` -```bash +```shell ❯ task dangerous task: "This is a dangerous command... Do you want to continue?" [y/N] ``` @@ -1542,7 +1542,7 @@ Warning prompts are called before executing a task. If a prompt is denied Task will exit with [exit code](/api#exit-codes) 205. If approved, Task will continue as normal. -```bash +```shell ❯ task example not dangerous command task: "This is a dangerous command. Do you want to continue?" [y/N] @@ -1579,14 +1579,14 @@ tasks: Normally this will be printed: -```sh +```shell echo "Print something" Print something ``` With silent mode on, the below will be printed instead: -```sh +```shell Print something ``` @@ -1733,7 +1733,7 @@ tasks: silent: true ``` -```bash +```shell $ task default ::group::default Hello, World! @@ -1758,7 +1758,7 @@ tasks: errors: echo 'output-of-errors' && exit 1 ``` -```bash +```shell $ task passes $ task errors output-of-errors @@ -1791,7 +1791,7 @@ tasks: silent: true ``` -```bash +```shell $ task default [print-foo] foo [print-bar] bar diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index b72ab4e7..693cdd35 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -254,7 +254,12 @@ const config: Config = { }, prism: { theme: lightCodeTheme, - darkTheme: darkCodeTheme + darkTheme: darkCodeTheme, + additionalLanguages: [ + "bash", // aka. shell + "json", + "powershell" + ] }, // NOTE(@andreynering): Don't worry, these keys are meant to be public =) algolia: {