@qvac/skills 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled.js +11 -29
- package/hash.js +1 -1
- package/package.json +1 -1
- package/skills/excel/SKILL.md +146 -111
- package/skills/gmail/SKILL.md +7 -4
- package/skills/google-calendar/SKILL.md +7 -4
- package/skills/google-docs/SKILL.md +7 -5
- package/skills/google-drive/SKILL.md +7 -4
- package/skills/google-sheets/SKILL.md +7 -5
- package/skills/music-generation/SKILL.md +15 -0
- package/skills/pdf/SKILL.md +146 -96
- package/skills/presentations/SKILL.md +133 -109
- package/skills/sheet-music/SKILL.md +93 -0
- package/skills/word/SKILL.md +144 -124
- package/skills/excel/references/create.md +0 -374
- package/skills/excel/references/edit.md +0 -357
- package/skills/excel/references/read.md +0 -99
- package/skills/pdf/references/create.md +0 -169
- package/skills/pdf/references/transform.md +0 -270
- package/skills/pdf/scripts/decrypt.py +0 -26
- package/skills/pdf/scripts/encrypt.py +0 -25
- package/skills/pdf/scripts/extract_text.py +0 -25
- package/skills/pdf/scripts/merge.py +0 -21
- package/skills/pdf/scripts/rotate.py +0 -27
- package/skills/presentations/references/create.md +0 -399
- package/skills/presentations/references/edit.md +0 -314
- package/skills/presentations/references/read.md +0 -127
- package/skills/word/references/create.md +0 -400
- package/skills/word/references/paragraphs.md +0 -125
- package/skills/word/references/read.md +0 -141
- package/skills/word/references/rework.md +0 -767
- package/skills/word/scripts/list_paragraphs.py +0 -25
- package/skills/word/scripts/replace_paragraphs.py +0 -58
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"""List every paragraph in a Word document, headings included.
|
|
2
|
-
|
|
3
|
-
Usage: list_paragraphs.py <input.docx>
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
import glob
|
|
7
|
-
import sys
|
|
8
|
-
|
|
9
|
-
from docx import Document
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# A call that stages the document but forgets scriptArgs still means that document.
|
|
13
|
-
staged = glob.glob("*.docx")
|
|
14
|
-
if len(sys.argv) == 1 and len(staged) == 1:
|
|
15
|
-
sys.argv.append(staged[0])
|
|
16
|
-
if len(sys.argv) != 2:
|
|
17
|
-
sys.exit(f"usage: list_paragraphs.py <input.docx> — got {sys.argv[1:]}")
|
|
18
|
-
|
|
19
|
-
source = sys.argv[1]
|
|
20
|
-
doc = Document(source)
|
|
21
|
-
|
|
22
|
-
for index, paragraph in enumerate(doc.paragraphs):
|
|
23
|
-
text = paragraph.text.replace("\n", " ")
|
|
24
|
-
print(f"{index}\t{paragraph.style.name}\t{text}")
|
|
25
|
-
print(f"{len(doc.paragraphs)} paragraphs, {len(doc.tables)} table(s)")
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"""Replace selected body paragraphs in a Word document.
|
|
2
|
-
|
|
3
|
-
Usage: replace_paragraphs.py <input.docx> <output.docx> <index> <new text> [<index> <new text> ...]
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
import sys
|
|
7
|
-
|
|
8
|
-
from docx import Document
|
|
9
|
-
|
|
10
|
-
usage = "usage: replace_paragraphs.py <input.docx> <output.docx> <index> <new text> [<index> <new text> ...]"
|
|
11
|
-
if len(sys.argv) < 5 or (len(sys.argv) - 3) % 2 != 0:
|
|
12
|
-
sys.exit(f"{usage} — got {sys.argv[1:]}")
|
|
13
|
-
|
|
14
|
-
source, target = sys.argv[1], sys.argv[2]
|
|
15
|
-
if source == target:
|
|
16
|
-
sys.exit(f"output {target} must be a new name, not the staged input")
|
|
17
|
-
|
|
18
|
-
doc = Document(source)
|
|
19
|
-
paragraphs = doc.paragraphs
|
|
20
|
-
replacements = []
|
|
21
|
-
seen = set()
|
|
22
|
-
|
|
23
|
-
for position in range(3, len(sys.argv), 2):
|
|
24
|
-
index_raw, new_text = sys.argv[position], sys.argv[position + 1]
|
|
25
|
-
try:
|
|
26
|
-
index = int(index_raw)
|
|
27
|
-
except ValueError:
|
|
28
|
-
sys.exit(f"index must be an integer, got: {index_raw}")
|
|
29
|
-
if index < 0 or index >= len(paragraphs):
|
|
30
|
-
sys.exit(f"index {index} is outside the document's {len(paragraphs)} paragraphs")
|
|
31
|
-
if index in seen:
|
|
32
|
-
sys.exit(f"index {index} was provided more than once")
|
|
33
|
-
if not new_text:
|
|
34
|
-
sys.exit(f"new text for index {index} must not be empty")
|
|
35
|
-
|
|
36
|
-
paragraph = paragraphs[index]
|
|
37
|
-
style_name = paragraph.style.name
|
|
38
|
-
if style_name.startswith("Heading") or style_name == "Title":
|
|
39
|
-
sys.exit(
|
|
40
|
-
f"index {index} is the heading {paragraph.text!r} — headings are not facts/points; "
|
|
41
|
-
"pick body paragraph indexes from list_paragraphs.py"
|
|
42
|
-
)
|
|
43
|
-
if new_text == paragraph.text:
|
|
44
|
-
sys.exit(f"index {index} already reads exactly that")
|
|
45
|
-
|
|
46
|
-
seen.add(index)
|
|
47
|
-
replacements.append((index, new_text))
|
|
48
|
-
|
|
49
|
-
before = len(paragraphs)
|
|
50
|
-
for index, new_text in replacements:
|
|
51
|
-
paragraphs[index].text = new_text
|
|
52
|
-
|
|
53
|
-
assert len(doc.paragraphs) == before
|
|
54
|
-
for index, new_text in replacements:
|
|
55
|
-
assert doc.paragraphs[index].text == new_text
|
|
56
|
-
|
|
57
|
-
doc.save(target)
|
|
58
|
-
print(f"{len(replacements)} of {before} paragraphs replaced")
|