Skip to content

Commit 31fc45d

Browse files
committed
docs: add since badge
wip wip wip
1 parent 6cb0a5a commit 31fc45d

File tree

9 files changed

+76
-10
lines changed

9 files changed

+76
-10
lines changed

website/docs/experiments/env_precedence.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
slug: '/experiments/env-precedence'
33
---
44

5-
# Env Precedence (#1038)
5+
import AvailableSinceBadge from '../../src/components/AvailableSince';
66

7+
# Env Precedence (#1038)
8+
<AvailableSinceBadge version="v3.39.0" />
79
:::caution
810

911
All experimental features are subject to breaking changes and/or removal _at any

website/docs/getting_started.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ slug: /getting-started/
33
sidebar_position: 3
44
---
55

6+
import AvailableSinceBadge from '../src/components/AvailableSince';
7+
68
# Getting Started
79

810
The following guide will help introduce you to the basics of Task. We'll cover
@@ -18,8 +20,13 @@ Once Task is installed, you can create your first Taskfile by running:
1820
task --init
1921
```
2022

21-
This will create a file called `Taskfile.yml` in the current directory. If you
22-
want to create the file in another directory, you can pass an absolute or
23+
This will create a file called `Taskfile.yml` in the current directory.
24+
25+
---
26+
27+
<AvailableSinceBadge version="v3.42.0" />
28+
29+
If you want to create the file in another directory, you can pass an absolute or
2330
relative path to the directory into the command:
2431

2532
```shell
@@ -33,6 +40,9 @@ the file:
3340
task --init Custom.yml
3441
```
3542

43+
---
44+
45+
3646
This will create a Taskfile that looks something like this:
3747

3848
```yaml

website/docs/reference/cli.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ If `--` is given, all remaining arguments will be assigned to a special
2121
## Flags
2222

2323
| Short | Flag | Type | Default | Description |
24-
| ----- | --------------------------- | -------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24+
|-------|-----------------------------|----------|----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2525
| `-c` | `--color` | `bool` | `true` | Colored output. Enabled by default. Set flag to `false` or use `NO_COLOR=1` to disable. |
2626
| `-C` | `--concurrency` | `int` | `0` | Limit number tasks to run concurrently. Zero means unlimited. |
2727
| `-d` | `--dir` | `string` | Working directory | Sets the directory in which Task will execute and look for a Taskfile. |
@@ -45,10 +45,10 @@ If `--` is given, all remaining arguments will be assigned to a special
4545
| `-y` | `--yes` | `bool` | `false` | Assume "yes" as answer to all prompts. |
4646
| | `--status` | `bool` | `false` | Exits with non-zero exit code if any of the given tasks is not up-to-date. |
4747
| | `--summary` | `bool` | `false` | Show summary about a task. |
48-
| `-t` | `--taskfile` | `string` | | Taskfile path to run.<br />Check the list of default filenames [here](../usage/#supported-file-names). |
48+
| `-t` | `--taskfile` | `string` | | Taskfile path to run.<br />Check the list of default filenames [here](../usage/#supported-file-names). |
4949
| `-v` | `--verbose` | `bool` | `false` | Enables verbose mode. |
5050
| | `--version` | `bool` | `false` | Show Task version. |
51-
| `-w` | `--watch` | `bool` | `false` | Enables watch of the given task.
51+
| `-w` | `--watch` | `bool` | `false` | Enables watch of the given task. |
5252

5353
## Exit Codes
5454

website/docs/taskfile_versions.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ slug: /taskfile-versions/
33
sidebar_position: 6
44
---
55

6+
import AvailableSinceBadge from '../src/components/AvailableSince';
7+
68
# Taskfile Versions
79

810
The Taskfile schema slowly changes as new features are added and old ones are
@@ -56,6 +58,8 @@ Instead, we should start the file like this:
5658
version: '3.17'
5759
```
5860

61+
<AvailableSinceBadge version="v3.34.0" />
62+
5963
Now when someone tries to run the Taskfile with an older version of Task, they
6064
will receive an error prompting them to upgrade their version of Task to
6165
`v3.17.0` or greater.

website/docs/usage.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ slug: /usage/
33
sidebar_position: 4
44
---
55

6+
import AvailableSinceBadge from '../src/components/AvailableSince';
67
import Tabs from '@theme/Tabs';
78
import TabItem from '@theme/TabItem';
89

@@ -311,6 +312,8 @@ includes:
311312

312313
### Flatten includes
313314

315+
<AvailableSinceBadge version="v3.39.0" />
316+
314317
You can flatten the included Taskfile tasks into the main Taskfile by using the `flatten` option.
315318
It means that the included Taskfile tasks will be available without the namespace.
316319

@@ -1100,7 +1103,7 @@ variable types are supported:
11001103
- `int`
11011104
- `float`
11021105
- `array`
1103-
- `map`
1106+
- `map` <AvailableSinceBadge version="v3.43.1" />
11041107

11051108
:::note
11061109

@@ -1373,6 +1376,7 @@ tasks:
13731376
```
13741377

13751378
### Looping over a matrix
1379+
<AvailableSinceBadge version="v3.39.0" />
13761380

13771381
If you need to loop over all permutations of multiple lists, you can use the
13781382
`matrix` property. This should be familiar to anyone who has used a matrix in a
@@ -1447,7 +1451,7 @@ tasks:
14471451

14481452
</TabItem>
14491453
<TabItem value="2" label="Generates">
1450-
1454+
<AvailableSinceBadge version="v3.43.1" />
14511455
```yaml
14521456
version: '3'
14531457
@@ -1495,7 +1499,7 @@ tasks:
14951499

14961500
</TabItem>
14971501
<TabItem value="2" label="Generates">
1498-
1502+
<AvailableSinceBadge version="v3.43.1" />
14991503
```yaml
15001504
version: '3'
15011505

website/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"react": "^19.0.0",
2828
"react-dom": "^19.0.0",
2929
"remark-gfm": "^4.0.0",
30-
"remark-github": "^12.0.0"
30+
"remark-github": "^12.0.0",
31+
"react-icons" : "^5.5.0"
3132
},
3233
"devDependencies": {
3334
"@docusaurus/module-type-aliases": "^3.5.2",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from 'react';
2+
import { FaCalendarCheck } from 'react-icons/fa';
3+
import { useColorMode } from '@docusaurus/theme-common';
4+
5+
type Props = {
6+
version: string;
7+
};
8+
9+
export default function AvailableSince({ version }: Props) {
10+
const { colorMode } = useColorMode();
11+
12+
const isDark = colorMode === 'dark';
13+
14+
const style = {
15+
display: 'inline-flex',
16+
alignItems: 'center',
17+
border: `1px solid var(--ifm-color-primary)`,
18+
color: isDark ? '#fffdf9' : 'var(--ifm-color-primary)',
19+
padding: '0.2em 0.6em',
20+
borderRadius: '999px',
21+
fontSize: '0.8em',
22+
fontWeight: 500,
23+
backgroundColor: isDark ? 'var(--ifm-color-primary)' : '#f0fdfa',
24+
marginBottom: 'calc(var(--ifm-heading-vertical-rhythm-bottom) * var(--ifm-leading))',
25+
};
26+
27+
28+
return (
29+
<span className="available-since-badge" style={style}>
30+
<FaCalendarCheck style={{ marginRight: '0.4em' }} />
31+
Since {version}
32+
</span>
33+
);
34+
}
35+
36+

website/src/css/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,7 @@
121121
.icon-bluesky::before {
122122
mask-image: url('/img/icon-bluesky.svg');
123123
}
124+
125+
h3:has(+ .available-since-badge) {
126+
margin-bottom: 0.5rem;
127+
}

website/yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7441,6 +7441,11 @@ react-fast-compare@^3.2.0:
74417441
react-fast-compare "^3.2.0"
74427442
shallowequal "^1.1.0"
74437443

7444+
react-icons@^5.5.0:
7445+
version "5.5.0"
7446+
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-5.5.0.tgz#8aa25d3543ff84231685d3331164c00299cdfaf2"
7447+
integrity sha512-MEFcXdkP3dLo8uumGI5xN3lDFNsRtrjbOEKDLD7yv76v4wpnEq2Lt2qeHaQOr34I/wPN3s3+N08WkQ+CW37Xiw==
7448+
74447449
react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0:
74457450
version "16.13.1"
74467451
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"

0 commit comments

Comments
 (0)