Skip to content

Cursorless tutorial #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: pokey # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
40 changes: 40 additions & 0 deletions src/tutorial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import json
import re

from talon import actions, app

regex = re.compile(r"\{(\w+):([^}]+)\}")


def process_tutorial_step(raw: str):
print([(match.group(1), match.group(2)) for match in regex.finditer(raw)])
content = raw

return {
"content": content,
"restore_callback": print,
"modes": ["command"],
"app": "Code",
"context_hint": "Please open VSCode and enter command mode",
}


def get_basic_coding_walkthrough():
with open(
"/Users/pokey/src/cursorless-vscode/src/test/suite/fixtures/recorded/tutorial/unit-2-basic-coding/script.json"
) as f:
script = json.load(f)

return [
actions.user.hud_create_walkthrough_step(**process_tutorial_step(step))
for step in script
]


def on_ready():
actions.user.hud_add_lazy_walkthrough(
"Cursorless basic coding", get_basic_coding_walkthrough
)


app.register("ready", on_ready)