diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..dec4065c --- /dev/null +++ b/.github/FUNDING.yml @@ -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'] diff --git a/src/tutorial.py b/src/tutorial.py new file mode 100644 index 00000000..afe03fb8 --- /dev/null +++ b/src/tutorial.py @@ -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)