Skip to content

Move HTML cheatsheet to home directory #884

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

Merged
merged 5 commits into from
Oct 11, 2022
Merged
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
10 changes: 6 additions & 4 deletions cursorless-talon/src/cheatsheet_html/cheat_sheet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import tempfile
import webbrowser
from pathlib import Path

Expand All @@ -18,7 +17,6 @@
tag: user.cursorless
"""

cheatsheet_out_dir = Path(tempfile.mkdtemp())
instructions_url = "https://www.cursorless.org/docs/"


Expand All @@ -44,8 +42,12 @@ def cursorless_open_instructions():
@ctx.action_class("user")
class Actions:
def cursorless_cheat_sheet_show_html():
"""Show new cursorless html cheat sheet"""
cheatsheet_out_path = cheatsheet_out_dir / "cheatsheet.html"
"""Show cursorless html cheat sheet"""
# NB: We use the user's home directory instead of temp to make sure that
# Linux snaps work
cheatsheet_out_dir = Path.home() / ".cursorless" / "cheatsheet"
cheatsheet_out_dir.mkdir(parents=True, exist_ok=True)
cheatsheet_out_path = cheatsheet_out_dir / "index.html"
run_rpc_command_and_wait(
"cursorless.showCheatsheet",
{
Expand Down