Skip to content

Commit 87a48a5

Browse files
deploy: f03c2f8
0 parents  commit 87a48a5

38 files changed

Lines changed: 16941 additions & 0 deletions

.nojekyll

Whitespace-only changes.

04_exhash.html

Lines changed: 676 additions & 0 deletions
Large diffs are not rendered by default.

04_exhash.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2+
3+
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
4+
5+
The quick brown fox jumps over the lazy dog. Jackdaws love my big sphinx
6+
of quartz. Pack my box with five dozen liquor jugs. How vexingly quick
7+
daft zebras jump! The five boxing wizards jump quickly. Sphinx of black
8+
quartz, judge my vow. Two driven jocks help fax my big quiz. Bright
9+
vixens jump; dozy fowl quack.
10+
11+
``` python
12+
msg = await read_msg()
13+
id_ = msg.id
14+
cts = msg.content
15+
```
16+
17+
------------------------------------------------------------------------
18+
19+
<a
20+
href="https://github.com/AnswerDotAI/dialoghelper/blob/main/dialoghelper/exhash.py#L12"
21+
target="_blank" style="float:right; font-size:smaller">source</a>
22+
23+
### lnhashview_msg
24+
25+
``` python
26+
async def lnhashview_msg(
27+
id:str, # id of message to view
28+
dname:str='', # Dialog containing message; defaults to current dialog
29+
start_line:int=None, # Starting line (1-based) to view (defaults to 1st line if None)
30+
end_line:int=None, # End line (defaults to last line if None)
31+
)->str:
32+
```
33+
34+
*Show lnhash-addressed lines of a message*
35+
36+
``` python
37+
await lnhashview_msg(id_, end_line=4)
38+
```
39+
40+
1|da2a|The quick brown fox jumps over the lazy dog.
41+
2|32e4|Jackdaws love my big sphinx of quartz.
42+
3|04e4|Pack my box with five dozen liquor jugs.
43+
4|025f|How vexingly quick daft zebras jump!
44+
45+
------------------------------------------------------------------------
46+
47+
<a
48+
href="https://github.com/AnswerDotAI/dialoghelper/blob/main/dialoghelper/exhash.py#L25"
49+
target="_blank" style="float:right; font-size:smaller">source</a>
50+
51+
### msg_exhash
52+
53+
``` python
54+
async def msg_exhash(
55+
id:str, # id of message to edit
56+
cmds:list, # List of exhash command tuples to apply
57+
dname:str='', # Dialog containing message; defaults to current dialog
58+
)->str:
59+
```
60+
61+
*Verified line-addressed editor. Apply command tuples to msg `id`
62+
contents, return lnhash diff.* **NB**: every command is a tuple whose
63+
first element is an address string. **NB**: hashes are checked against
64+
the current text immediately before each command runs; order commands
65+
last-\>first.
66+
67+
Use `lnhashview_msg(id)` to get hash-verified addresses before first
68+
use.
69+
70+
Address strings: Single: `12|a3f2|` Range: `12|a3f2|,15|b1c3|` Last: `$`
71+
(last line) Whole: `%` (whole file, same as `1,$`) Special: `0|0000|`
72+
targets before line 1 (only with a or i)
73+
74+
Command tuples: (addr, “s”, pattern, replacement\[, flags\]) Substitute
75+
(Rust regex syntax). Replacement supports $1, $0, ${name}. Flags: g=all,
76+
i=case-insensitive. args may contain literal / & newlines (addr, “d”)
77+
Delete line(s) (addr, “a”, text) Append payload after line (addr, “i”,
78+
text) Insert payload before line (addr, “c”, text) Change/replace with
79+
payload (addr, “j”) Join with next line; with range, joins all (addr,
80+
“m”, dest) Move line(s) after dest address (addr, “t”, dest) Copy
81+
line(s) after dest address (addr, “\>”, n) Indent n levels (default 1, 4
82+
spaces each) (addr, “\<”, n) Dedent n levels (default 1) (addr, “sort”)
83+
Sort lines alphabetically (addr, “p”) Print (include in output without
84+
changing) (addr, “g”, payload), (addr, “g!”, payload), (addr, “v”,
85+
payload) Global commands; payload uses compact ex syntax such as
86+
`/pattern/d` (addr, “y”, payload) Transliterate; payload uses compact ex
87+
syntax such as `/abc/ABC/`
88+
89+
`cmds` is a required list of command tuples. Text fields may contain
90+
newlines, including multiline a/i/c payloads and s pattern/replacement
91+
fields; payloads are inserted literally. Do NOT add a trailing `.` line
92+
— the string boundary ends the block. A trailing `.` will be inserted
93+
literally (with a warning).

capture.html

Lines changed: 717 additions & 0 deletions
Large diffs are not rendered by default.

capture.html.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# capture
2+
3+
4+
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
5+
6+
``` python
7+
from IPython.display import display, Image
8+
```
9+
10+
------------------------------------------------------------------------
11+
12+
<a
13+
href="https://github.com/AnswerDotAI/dialoghelper/blob/main/dialoghelper/capture.py#L21"
14+
target="_blank" style="float:right; font-size:smaller">source</a>
15+
16+
### setup_share
17+
18+
``` python
19+
def setup_share():
20+
```
21+
22+
*Setup screen sharing*
23+
24+
``` python
25+
setup_share()
26+
```
27+
28+
------------------------------------------------------------------------
29+
30+
<a
31+
href="https://github.com/AnswerDotAI/dialoghelper/blob/main/dialoghelper/capture.py#L28"
32+
target="_blank" style="float:right; font-size:smaller">source</a>
33+
34+
### start_share
35+
36+
``` python
37+
def start_share():
38+
```
39+
40+
*Call self as a function.*
41+
42+
``` python
43+
start_share()
44+
```
45+
46+
<script>
47+
if (Date.now() - 1772491113277 < 5000 && !window["_trig_1772491113277"]) {
48+
window["_trig_1772491113277"]=1;
49+
htmx.trigger(document.body, 'shareScreen');
50+
}</script>
51+
52+
------------------------------------------------------------------------
53+
54+
<a
55+
href="https://github.com/AnswerDotAI/dialoghelper/blob/main/dialoghelper/capture.py#L36"
56+
target="_blank" style="float:right; font-size:smaller">source</a>
57+
58+
### capture_screen
59+
60+
``` python
61+
async def capture_screen(
62+
timeout:int=15
63+
):
64+
```
65+
66+
*Capture the screen as a PIL image.*
67+
68+
------------------------------------------------------------------------
69+
70+
<a
71+
href="https://github.com/AnswerDotAI/dialoghelper/blob/main/dialoghelper/capture.py#L44"
72+
target="_blank" style="float:right; font-size:smaller">source</a>
73+
74+
### capture_tool
75+
76+
``` python
77+
async def capture_tool(
78+
timeout:int=15
79+
):
80+
```
81+
82+
*Capture the screen. Re-call this function to get the most recent
83+
screenshot, as needed. Use default timeout where possible*
84+
85+
``` python
86+
# Don't run-all -- only run this after choosing a window to share
87+
img = await capture_screen()
88+
img.thumbnail((700,700))
89+
```
90+
91+
``` python
92+
# img
93+
```

0 commit comments

Comments
 (0)