Skip to content

Commit 6355587

Browse files
Remove position from tutorial identifiers (#3343)
1 parent 9da7941 commit 6355587

34 files changed

Lines changed: 110 additions & 113 deletions

‎cursorless-talon/src/cursorless.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def private_cursorless_show_command_statistics():
3434
def private_cursorless_start_tutorial():
3535
"""Start the introductory Cursorless tutorial"""
3636
actions.user.private_cursorless_run_rpc_command_no_wait(
37-
"cursorless.tutorial.start", "1-introduction"
37+
"cursorless.tutorial.start", "introduction"
3838
)
3939

4040
def private_cursorless_tutorial_next():

‎packages/app-web-docs/src/docs/user/tutorial/README.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ To follow along interactively, focus VS Code and say `"cursorless tutorial"`.
66

77
## 1. Introduction
88

9-
[Start Introduction](./1-introduction.mdx) - This tutorial will teach you the basics of Cursorless.
9+
[Start Introduction](./introduction.mdx) - This tutorial will teach you the basics of Cursorless.
1010

1111
## 2. Basic coding
1212

13-
[Start Basic coding](./2-basic-coding.mdx) - This tutorial will teach you the basics of coding with Cursorless.
13+
[Start Basic coding](./basic-coding.mdx) - This tutorial will teach you the basics of coding with Cursorless.
1414

1515
## Use the interactive tutorial
1616

packages/app-web-docs/src/docs/user/tutorial/2-basic-coding.mdx renamed to packages/app-web-docs/src/docs/user/tutorial/basic-coding.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RecordedTestVisualizer, RecordedTestVisualizerOptions, RecordedTestVisualizerProvider } from "@site/src/docs/components/RecordedTestVisualizer";
2-
import recordedTests from "./fixtures/2-basic-coding.json";
2+
import recordedTests from "./fixtures/basic-coding.json";
33

44
# 2. Basic coding
55

@@ -13,47 +13,47 @@ This tutorial will teach you the basics of coding with Cursorless.
1313

1414
When editing code, we often think in terms of statements, functions, etc. Let's clone a statement: `"clone state sit"`
1515

16-
<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/cloneStateInk" />
16+
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/cloneStateInk" />
1717

1818
## Step 2
1919

2020
Cursorless tries its best to keep your commands short.
2121

2222
In the following command, we just say "string" once, but Cursorless infers that both targets are strings: `"swap string air with whale"`
2323

24-
<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/swapStringAirWithWhale" />
24+
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/swapStringAirWithWhale" />
2525

2626
## Step 3
2727

2828
Great. Let's learn a new action. The "pour" action lets you start editing a new line below any line on your screen: `"pour urge"`
2929

30-
<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/pourUrge" />
30+
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/pourUrge" />
3131

3232
## Step 4
3333

3434
Now let's try applying a Cursorless action to the current line: `"dedent this"`
3535

36-
<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/dedentThis" />
36+
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/dedentThis" />
3737

3838
## Step 5
3939

4040
Code reuse is a fact of life as a programmer. Cursorless makes this easy with the "bring" command: `"bring state urge"`
4141

42-
<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/bringStateUrge" />
42+
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/bringStateUrge" />
4343

4444
## Step 6
4545

4646
"bring" also works with two targets just like "swap": `"bring blue cap to value red"`
4747

48-
<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/bringBlueCapToValueRisk" />
48+
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/bringBlueCapToValueRisk" />
4949

5050
## Step 7
5151

5252
Cursorless tries its best to use its knowledge of programming languages to leave you with syntactically valid code.
5353

5454
Note how it cleans up the comma here: `"chuck arg blue vest"`
5555

56-
<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/chuckArgueBlueVest" />
56+
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/chuckArgueBlueVest" />
5757

5858
## Step 8
5959

packages/app-web-docs/src/docs/user/tutorial/fixtures/2-basic-coding.json renamed to packages/app-web-docs/src/docs/user/tutorial/fixtures/basic-coding.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
3-
"path": "tutorial/2-basic-coding/cloneStateInk.yml",
4-
"name": "tutorial/2-basic-coding/cloneStateInk",
3+
"path": "tutorial/basic-coding/cloneStateInk.yml",
4+
"name": "tutorial/basic-coding/cloneStateInk",
55
"fixture": {
66
"languageId": "python",
77
"command": {
@@ -1547,8 +1547,8 @@
15471547
}
15481548
},
15491549
{
1550-
"path": "tutorial/2-basic-coding/swapStringAirWithWhale.yml",
1551-
"name": "tutorial/2-basic-coding/swapStringAirWithWhale",
1550+
"path": "tutorial/basic-coding/swapStringAirWithWhale.yml",
1551+
"name": "tutorial/basic-coding/swapStringAirWithWhale",
15521552
"fixture": {
15531553
"languageId": "python",
15541554
"command": {
@@ -3211,8 +3211,8 @@
32113211
}
32123212
},
32133213
{
3214-
"path": "tutorial/2-basic-coding/pourUrge.yml",
3215-
"name": "tutorial/2-basic-coding/pourUrge",
3214+
"path": "tutorial/basic-coding/pourUrge.yml",
3215+
"name": "tutorial/basic-coding/pourUrge",
32163216
"fixture": {
32173217
"languageId": "python",
32183218
"command": {
@@ -4848,8 +4848,8 @@
48484848
}
48494849
},
48504850
{
4851-
"path": "tutorial/2-basic-coding/dedentThis.yml",
4852-
"name": "tutorial/2-basic-coding/dedentThis",
4851+
"path": "tutorial/basic-coding/dedentThis.yml",
4852+
"name": "tutorial/basic-coding/dedentThis",
48534853
"fixture": {
48544854
"languageId": "python",
48554855
"command": {
@@ -6472,8 +6472,8 @@
64726472
}
64736473
},
64746474
{
6475-
"path": "tutorial/2-basic-coding/bringStateUrge.yml",
6476-
"name": "tutorial/2-basic-coding/bringStateUrge",
6475+
"path": "tutorial/basic-coding/bringStateUrge.yml",
6476+
"name": "tutorial/basic-coding/bringStateUrge",
64776477
"fixture": {
64786478
"languageId": "python",
64796479
"command": {
@@ -8148,8 +8148,8 @@
81488148
}
81498149
},
81508150
{
8151-
"path": "tutorial/2-basic-coding/bringBlueCapToValueRisk.yml",
8152-
"name": "tutorial/2-basic-coding/bringBlueCapToValueRisk",
8151+
"path": "tutorial/basic-coding/bringBlueCapToValueRisk.yml",
8152+
"name": "tutorial/basic-coding/bringBlueCapToValueRisk",
81538153
"fixture": {
81548154
"languageId": "python",
81558155
"command": {
@@ -9871,8 +9871,8 @@
98719871
}
98729872
},
98739873
{
9874-
"path": "tutorial/2-basic-coding/chuckArgueBlueVest.yml",
9875-
"name": "tutorial/2-basic-coding/chuckArgueBlueVest",
9874+
"path": "tutorial/basic-coding/chuckArgueBlueVest.yml",
9875+
"name": "tutorial/basic-coding/chuckArgueBlueVest",
98769876
"fixture": {
98779877
"languageId": "python",
98789878
"command": {

packages/app-web-docs/src/docs/user/tutorial/fixtures/1-introduction.json renamed to packages/app-web-docs/src/docs/user/tutorial/fixtures/introduction.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
3-
"path": "tutorial/1-introduction/takeCap.yml",
4-
"name": "tutorial/1-introduction/takeCap",
3+
"path": "tutorial/introduction/takeCap.yml",
4+
"name": "tutorial/introduction/takeCap",
55
"fixture": {
66
"languageId": "plaintext",
77
"command": {
@@ -629,8 +629,8 @@
629629
}
630630
},
631631
{
632-
"path": "tutorial/1-introduction/takeBlueSun.yml",
633-
"name": "tutorial/1-introduction/takeBlueSun",
632+
"path": "tutorial/introduction/takeBlueSun.yml",
633+
"name": "tutorial/introduction/takeBlueSun",
634634
"fixture": {
635635
"languageId": "plaintext",
636636
"command": {
@@ -1258,8 +1258,8 @@
12581258
}
12591259
},
12601260
{
1261-
"path": "tutorial/1-introduction/takeHarpPastDrum.yml",
1262-
"name": "tutorial/1-introduction/takeHarpPastDrum",
1261+
"path": "tutorial/introduction/takeHarpPastDrum.yml",
1262+
"name": "tutorial/introduction/takeHarpPastDrum",
12631263
"fixture": {
12641264
"languageId": "plaintext",
12651265
"command": {
@@ -1910,8 +1910,8 @@
19101910
}
19111911
},
19121912
{
1913-
"path": "tutorial/1-introduction/takeNearAndSun.yml",
1914-
"name": "tutorial/1-introduction/takeNearAndSun",
1913+
"path": "tutorial/introduction/takeNearAndSun.yml",
1914+
"name": "tutorial/introduction/takeNearAndSun",
19151915
"fixture": {
19161916
"languageId": "plaintext",
19171917
"command": {
@@ -2572,8 +2572,8 @@
25722572
}
25732573
},
25742574
{
2575-
"path": "tutorial/1-introduction/chuckTrap.yml",
2576-
"name": "tutorial/1-introduction/chuckTrap",
2575+
"path": "tutorial/introduction/chuckTrap.yml",
2576+
"name": "tutorial/introduction/chuckTrap",
25772577
"fixture": {
25782578
"languageId": "plaintext",
25792579
"command": {
@@ -3207,8 +3207,8 @@
32073207
}
32083208
},
32093209
{
3210-
"path": "tutorial/1-introduction/chuckLineOdd.yml",
3211-
"name": "tutorial/1-introduction/chuckLineOdd",
3210+
"path": "tutorial/introduction/chuckLineOdd.yml",
3211+
"name": "tutorial/introduction/chuckLineOdd",
32123212
"fixture": {
32133213
"languageId": "plaintext",
32143214
"command": {
@@ -3752,8 +3752,8 @@
37523752
}
37533753
},
37543754
{
3755-
"path": "tutorial/1-introduction/takeLine.yml",
3756-
"name": "tutorial/1-introduction/takeLine",
3755+
"path": "tutorial/introduction/takeLine.yml",
3756+
"name": "tutorial/introduction/takeLine",
37573757
"fixture": {
37583758
"languageId": "plaintext",
37593759
"command": {
@@ -4187,8 +4187,8 @@
41874187
}
41884188
},
41894189
{
4190-
"path": "tutorial/1-introduction/preUrge.yml",
4191-
"name": "tutorial/1-introduction/preUrge",
4190+
"path": "tutorial/introduction/preUrge.yml",
4191+
"name": "tutorial/introduction/preUrge",
41924192
"fixture": {
41934193
"languageId": "plaintext",
41944194
"command": {
@@ -4620,8 +4620,8 @@
46204620
}
46214621
},
46224622
{
4623-
"path": "tutorial/1-introduction/postAir.yml",
4624-
"name": "tutorial/1-introduction/postAir",
4623+
"path": "tutorial/introduction/postAir.yml",
4624+
"name": "tutorial/introduction/postAir",
46254625
"fixture": {
46264626
"languageId": "plaintext",
46274627
"command": {
@@ -5053,8 +5053,8 @@
50535053
}
50545054
},
50555055
{
5056-
"path": "tutorial/1-introduction/changeSit.yml",
5057-
"name": "tutorial/1-introduction/changeSit",
5056+
"path": "tutorial/introduction/changeSit.yml",
5057+
"name": "tutorial/introduction/changeSit",
50585058
"fixture": {
50595059
"languageId": "plaintext",
50605060
"command": {

packages/app-web-docs/src/docs/user/tutorial/1-introduction.mdx renamed to packages/app-web-docs/src/docs/user/tutorial/introduction.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RecordedTestVisualizer, RecordedTestVisualizerOptions, RecordedTestVisualizerProvider } from "@site/src/docs/components/RecordedTestVisualizer";
2-
import recordedTests from "./fixtures/1-introduction.json";
2+
import recordedTests from "./fixtures/introduction.json";
33

44
# 1. Introduction
55

@@ -13,69 +13,69 @@ This tutorial will teach you the basics of Cursorless.
1313

1414
Say `"take cap"`
1515

16-
<RecordedTestVisualizer fixtureName="tutorial/1-introduction/takeCap" />
16+
<RecordedTestVisualizer fixtureName="tutorial/introduction/takeCap" />
1717

1818
## Step 2
1919

2020
Well done! 🙌 You just used the code word for 'c', "cap", to refer to the word with a gray hat over the 'c'.
2121

2222
When a hat is not gray, we say its color: say `"take blue sun"`
2323

24-
<RecordedTestVisualizer fixtureName="tutorial/1-introduction/takeBlueSun" />
24+
<RecordedTestVisualizer fixtureName="tutorial/introduction/takeBlueSun" />
2525

2626
## Step 3
2727

2828
Selecting a single token is great, but often we need something bigger.
2929

3030
Say `"take harp past drum"` to select a range.
3131

32-
<RecordedTestVisualizer fixtureName="tutorial/1-introduction/takeHarpPastDrum" />
32+
<RecordedTestVisualizer fixtureName="tutorial/introduction/takeHarpPastDrum" />
3333

3434
## Step 4
3535

3636
Despite its name, one of the most powerful aspects of Cursorless is the ability to use more than one cursor.
3737

3838
Let's try that: `"take near and sun"`
3939

40-
<RecordedTestVisualizer fixtureName="tutorial/1-introduction/takeNearAndSun" />
40+
<RecordedTestVisualizer fixtureName="tutorial/introduction/takeNearAndSun" />
4141

4242
## Step 5
4343

4444
But let's show that Cursorless can live up to its name: we can say `"chuck trap"` to delete a word without ever moving our cursor.
4545

46-
<RecordedTestVisualizer fixtureName="tutorial/1-introduction/chuckTrap" />
46+
<RecordedTestVisualizer fixtureName="tutorial/introduction/chuckTrap" />
4747

4848
## Step 6
4949

5050
Tokens are great, but they're just one way to think of a document.
5151

5252
Let's try working with lines: `"chuck line odd"`
5353

54-
<RecordedTestVisualizer fixtureName="tutorial/1-introduction/chuckLineOdd" />
54+
<RecordedTestVisualizer fixtureName="tutorial/introduction/chuckLineOdd" />
5555

5656
## Step 7
5757

5858
We can also use "line" to refer to the line containing our cursor: `"take line"`
5959

60-
<RecordedTestVisualizer fixtureName="tutorial/1-introduction/takeLine" />
60+
<RecordedTestVisualizer fixtureName="tutorial/introduction/takeLine" />
6161

6262
## Step 8
6363

6464
You now know how to select and delete; let's give you a couple more actions to play with: say "pre" to place the cursor before a target, as in `"pre urge"`
6565

66-
<RecordedTestVisualizer fixtureName="tutorial/1-introduction/preUrge" />
66+
<RecordedTestVisualizer fixtureName="tutorial/introduction/preUrge" />
6767

6868
## Step 9
6969

7070
Say "post" to place the cursor after a target: `"post air"`
7171

72-
<RecordedTestVisualizer fixtureName="tutorial/1-introduction/postAir" />
72+
<RecordedTestVisualizer fixtureName="tutorial/introduction/postAir" />
7373

7474
## Step 10
7575

7676
Say "change" to delete a word and move your cursor to where it used to be: `"change sit"`
7777

78-
<RecordedTestVisualizer fixtureName="tutorial/1-introduction/changeSit" />
78+
<RecordedTestVisualizer fixtureName="tutorial/introduction/changeSit" />
7979

8080
## Step 11
8181

@@ -85,4 +85,4 @@ And that wraps up unit 1 of the Cursorless tutorial! Next time, we'll write some
8585

8686
## Next tutorial: 2. Basic coding
8787

88-
[Continue to Basic coding](./2-basic-coding.mdx) - This tutorial will teach you the basics of coding with Cursorless.
88+
[Continue to Basic coding](./basic-coding.mdx) - This tutorial will teach you the basics of coding with Cursorless.

packages/lib-common/src/tutorials/tutorial2BasicCoding.ts renamed to packages/lib-common/src/tutorials/tutorialBasicCoding.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { RawTutorialContent } from "./tutorial.types";
22

3-
export const tutorial2BasicCoding: RawTutorialContent = {
4-
id: "2-basic-coding",
3+
export const tutorialBasicCoding: RawTutorialContent = {
4+
id: "basic-coding",
55
title: "Basic coding",
66
description:
77
"This tutorial will teach you the basics of coding with Cursorless.",

packages/lib-common/src/tutorials/tutorial1Introduction.ts renamed to packages/lib-common/src/tutorials/tutorialIntroduction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type { RawTutorialContent } from "./tutorial.types";
33
const wrapsUp =
44
"And that wraps up unit 1 of the Cursorless tutorial! Next time, we'll write some code 🙌.";
55

6-
export const tutorial1Introduction: RawTutorialContent = {
7-
id: "1-introduction",
6+
export const tutorialIntroduction: RawTutorialContent = {
7+
id: "introduction",
88
title: "Introduction",
99
description: "This tutorial will teach you the basics of Cursorless.",
1010
steps: [

packages/lib-common/src/tutorials/tutorial3Visualization.ts renamed to packages/lib-common/src/tutorials/tutorialVisualization.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { RawTutorialContent } from "./tutorial.types";
22

3-
export const tutorial3Visualization: RawTutorialContent = {
4-
id: "3-visualization",
3+
export const tutorialVisualization: RawTutorialContent = {
4+
id: "visualization",
55
title: "Visualization",
66
description:
77
"This tutorial will teach you how to visualize different scopes in Cursorless.",

0 commit comments

Comments
 (0)