mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-26 00:46:23 +02:00
use builtin tools for writing file
This commit is contained in:
parent
89e5a7f8bc
commit
fc1e1b628e
1 changed files with 12 additions and 7 deletions
|
|
@ -7,20 +7,22 @@ Activate when the user wants to create presentations, slide decks, or pitch deck
|
|||
|
||||
## Workflow
|
||||
|
||||
1. Check ~/.rowboat/knowledge/ for relevant context about the company, product, team, etc.
|
||||
1. Use workspace-readFile to check knowledge/ for relevant context about the company, product, team, etc.
|
||||
2. Ensure Playwright is installed: 'npm install playwright && npx playwright install chromium'
|
||||
3. Create an HTML file (e.g., /tmp/presentation.html) with slides (1280x720px each)
|
||||
4. Create a Node.js script to convert HTML to PDF:
|
||||
3. Use workspace-getRoot to get the workspace root path.
|
||||
4. Use workspace-writeFile to create the HTML file at tmp/presentation.html (workspace-relative) with slides (1280x720px each).
|
||||
5. Use workspace-writeFile to create a Node.js conversion script at tmp/convert.js (workspace-relative):
|
||||
|
||||
~~~javascript
|
||||
// save as /tmp/convert.js
|
||||
// save as tmp/convert.js via workspace-writeFile
|
||||
const { chromium } = require('playwright');
|
||||
const path = require('path');
|
||||
|
||||
(async () => {
|
||||
const browser = await chromium.launch();
|
||||
const page = await browser.newPage();
|
||||
await page.goto('file:///tmp/presentation.html', { waitUntil: 'networkidle' });
|
||||
// Use the workspace root path from workspace-getRoot
|
||||
await page.goto('file://<WORKSPACE_ROOT>/tmp/presentation.html', { waitUntil: 'networkidle' });
|
||||
await page.pdf({
|
||||
path: path.join(process.env.HOME, 'Desktop', 'presentation.pdf'),
|
||||
width: '1280px',
|
||||
|
|
@ -32,10 +34,13 @@ const path = require('path');
|
|||
})();
|
||||
~~~
|
||||
|
||||
5. Run it: 'node /tmp/convert.js'
|
||||
6. Tell the user: "Your presentation is ready at ~/Desktop/presentation.pdf"
|
||||
Replace <WORKSPACE_ROOT> with the actual absolute path returned by workspace-getRoot.
|
||||
|
||||
6. Run it: 'node <WORKSPACE_ROOT>/tmp/convert.js'
|
||||
7. Tell the user: "Your presentation is ready at ~/Desktop/presentation.pdf"
|
||||
|
||||
Do NOT show HTML code to the user. Do NOT explain how to export. Just create the PDF and deliver it.
|
||||
Use workspace-writeFile and workspace-readFile for ALL file operations. Do NOT use executeCommand to write or read files.
|
||||
|
||||
## PDF Export Rules
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue