Skip to content

Commit 2c24c55

Browse files
dveltonCopilot
andcommitted
Address Copilot code review feedback
- Fix browser leak in render_url_to_pdf (try/finally around Playwright) - Remove setup.sh references from SKILL.md (not bundled in plugin) - Use consistent <path-to>/eyeball.py paths in SKILL.md - Update plugin README install instructions for awesome-copilot - Add Windows pywin32 install step to SKILL.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4626aaf commit 2c24c55

3 files changed

Lines changed: 38 additions & 53 deletions

File tree

plugins/eyeball/README.md

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,44 +22,25 @@ If the analysis says "Section 9.3 allows termination for cause with a 30-day cur
2222

2323
### Install the plugin
2424

25-
Point your CLI at this repo and ask it to install the plugin for you, with this prompt:
25+
Install via the Copilot CLI plugin system. In a Copilot CLI conversation:
2626

2727
```
28-
Install the plugin at github.com/dvelton/eyeball for me.
29-
```
30-
31-
Or:
32-
33-
Install via the Copilot CLI plugin system, or clone the repo:
34-
35-
```bash
36-
git clone https://github.com/dvelton/eyeball.git
28+
install the eyeball plugin from github/awesome-copilot
3729
```
3830

3931
### Install dependencies
4032

41-
**macOS / Linux:**
42-
43-
```bash
44-
cd eyeball
45-
bash setup.sh
46-
```
47-
48-
**Windows (PowerShell):**
49-
50-
```powershell
51-
cd eyeball
52-
.\setup.ps1
53-
```
54-
55-
**Manual install (any platform):**
33+
After installing the plugin, install the Python dependencies:
5634

5735
```bash
5836
pip install pymupdf pillow python-docx playwright
5937
python -m playwright install chromium
6038
```
6139

62-
On Windows, `pywin32` is also needed for Microsoft Word automation and is installed automatically by the setup script.
40+
On Windows, also install pywin32 for Word automation:
41+
```bash
42+
pip install pywin32
43+
```
6344

6445
### Verify setup
6546

skills/eyeball/SKILL.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ Before first use, check that dependencies are installed:
4242
python3 <path-to>/eyeball.py setup-check
4343
```
4444

45-
If anything is missing, run the setup script from the eyeball plugin directory:
45+
If anything is missing, install the required dependencies:
4646
```bash
47-
bash <path-to>/setup.sh
47+
pip3 install pymupdf pillow python-docx playwright
48+
python3 -m playwright install chromium
4849
```
4950

50-
Or install manually:
51+
On Windows, also install pywin32 for Word automation:
5152
```bash
52-
pip3 install pymupdf pillow python-docx playwright
53-
python3 -m playwright install chromium
53+
pip install pywin32
5454
```
5555

5656
## Workflow
@@ -62,7 +62,7 @@ Follow these steps exactly. The order matters.
6262
Before writing any analysis, extract and read the full text of the source document:
6363

6464
```bash
65-
python3 eyeball.py extract-text --source "<path-or-url>"
65+
python3 <path-to>/eyeball.py extract-text --source "<path-or-url>"
6666
```
6767

6868
Read the output carefully. Identify actual section numbers, headings, page numbers, and key language.
@@ -118,7 +118,7 @@ RIGHT -- includes the section number for precision, targets the correct page:
118118
Construct a JSON array of sections and call the build command:
119119

120120
```bash
121-
python3 eyeball.py build \
121+
python3 <path-to>/eyeball.py build \
122122
--source "<path-or-url>" \
123123
--output ~/Desktop/<title>.docx \
124124
--title "Analysis Title" \

skills/eyeball/tools/eyeball.py

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -241,26 +241,30 @@ def render_url_to_pdf(url, output_pdf_path):
241241
)
242242

243243
with sync_playwright() as p:
244-
browser = p.chromium.launch(headless=True)
245-
page = browser.new_page()
246-
page.goto(url, wait_until="networkidle", timeout=30000)
247-
248-
# Clean up navigation/footer elements for cleaner output
249-
page.evaluate("""
250-
document.querySelectorAll(
251-
'header, footer, nav, [data-testid="header"], [data-testid="footer"], '
252-
+ '.site-header, .site-footer, #cookie-banner, .cookie-consent'
253-
).forEach(el => el.remove());
254-
""")
255-
256-
page.pdf(
257-
path=output_pdf_path,
258-
format="Letter",
259-
print_background=True,
260-
margin={"top": "0.5in", "bottom": "0.5in",
261-
"left": "0.75in", "right": "0.75in"}
262-
)
263-
browser.close()
244+
browser = None
245+
try:
246+
browser = p.chromium.launch(headless=True)
247+
page = browser.new_page()
248+
page.goto(url, wait_until="networkidle", timeout=30000)
249+
250+
# Clean up navigation/footer elements for cleaner output
251+
page.evaluate("""
252+
document.querySelectorAll(
253+
'header, footer, nav, [data-testid="header"], [data-testid="footer"], '
254+
+ '.site-header, .site-footer, #cookie-banner, .cookie-consent'
255+
).forEach(el => el.remove());
256+
""")
257+
258+
page.pdf(
259+
path=output_pdf_path,
260+
format="Letter",
261+
print_background=True,
262+
margin={"top": "0.5in", "bottom": "0.5in",
263+
"left": "0.75in", "right": "0.75in"}
264+
)
265+
finally:
266+
if browser is not None:
267+
browser.close()
264268

265269

266270
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)