-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdemo_tui.py
More file actions
58 lines (50 loc) · 1.49 KB
/
demo_tui.py
File metadata and controls
58 lines (50 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python3
"""
Demo script to showcase the Logseq TUI.
Runs in demo mode with a temporary graph.
"""
import sys
from pathlib import Path
# Add parent directory to path
sys.path.insert(0, str(Path(__file__).parent))
from logseq_py.tui import launch_tui
def main():
"""Launch TUI with demo graph."""
demo_graph = "/tmp/logseq-demo-graph"
print("=" * 60)
print(" LOGSEQ TUI DEMO")
print("=" * 60)
print()
print(f"Demo graph location: {demo_graph}")
print()
print("FEATURES:")
print(" 📅 Journals - Browse and edit daily journals")
print(" 📄 Pages - View and edit all pages")
print(" 📋 Templates - Manage templates with variables")
print(" 🔍 Search - Full-text search across graph")
print()
print("KEYBOARD SHORTCUTS:")
print(" Ctrl+J - Switch to Journals")
print(" Ctrl+P - Switch to Pages")
print(" Ctrl+T - Switch to Templates")
print(" Ctrl+F - Search")
print(" Ctrl+S - Save current page")
print(" j/k - Navigate lists (vim-style)")
print(" q - Quit")
print()
print("=" * 60)
print("Launching TUI in 2 seconds...")
print("=" * 60)
print()
import time
time.sleep(2)
try:
launch_tui(demo_graph)
except KeyboardInterrupt:
print("\n\nTUI closed by user.")
except Exception as e:
print(f"\nError: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
main()