-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.html
More file actions
54 lines (50 loc) · 1.8 KB
/
Copy pathcommands.html
File metadata and controls
54 lines (50 loc) · 1.8 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
---
layout: default
title: Commands
---
<div class="page">
<h1>Commands</h1>
<p>Granular, single-purpose prompts designed for quick, targeted actions. Use a Command when you need a quick intervention from Jules.</p>
{%- assign commands = site.prompts | where: "type", "Command" -%}
{%- assign commands_by_category = commands | group_by: "category" -%}
{%- for category in commands_by_category -%}
<h2 class="category-title">{{ category.name }}</h2>
<ul class="prompt-list">
{%- assign sorted_prompts = category.items | sort: "title" -%}
{%- for prompt in sorted_prompts -%}
<li>
<div class="prompt-actions">
<button class="btn copy-btn" data-clipboard-target="#{{ prompt.slug }}">Copy</button>
</div>
<h3>{{ prompt.title }}</h3>
<p>{{ prompt.description }}</p>
<div class="prompt-content-wrapper">
<pre id="{{ prompt.slug }}"><code>{{ prompt.content | strip }}</code></pre>
</div>
</li>
{%- endfor -%}
</ul>
{%- endfor -%}
</div>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
const copyButtons = document.querySelectorAll('.copy-btn');
copyButtons.forEach(button => {
button.addEventListener('click', () => {
const targetId = button.getAttribute('data-clipboard-target');
const targetElement = document.querySelector(targetId);
if (targetElement) {
navigator.clipboard.writeText(targetElement.innerText).then(() => {
button.innerText = 'Copied!';
setTimeout(() => {
button.innerText = 'Copy';
}, 2000);
}).catch(err => {
console.error('Failed to copy text: ', err);
alert('Failed to copy prompt. See console for details.');
});
}
});
});
});
</script>