wrapt-cli 0.1.4 → 0.1.5

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/README.md CHANGED
@@ -48,8 +48,8 @@ Step-by-step guide: **https://wrapt.cc**
48
48
  | Format | Size | For |
49
49
  |---|---|---|
50
50
  | 8 story cards | 1080 × 1920 | Instagram Stories |
51
- | 8 carousel cards | 1080 × 1350 | Instagram carousel post |
52
- | 8-page PDF | 1080 × 1350 | LinkedIn document post |
51
+ | 8 carousel cards | 1080 × 1350 | Instagram carousel, or a LinkedIn image post (easiest) |
52
+ | 8-page PDF | 1080 × 1350 | LinkedIn document post (swipeable in the feed) |
53
53
  | 1 summary card | 1200 × 675 | X |
54
54
 
55
55
  The eight cards: your name and year, your biggest number (tokens, hours or prompts), when you
package/dist/cli.js CHANGED
@@ -159,9 +159,9 @@ async function main(argv) {
159
159
  "",
160
160
  ` Saved in ${shown(dir)}`,
161
161
  row("story/", `${n} Instagram Story cards (1080 × 1920)`),
162
- row("carousel/", `${res.carousel.length} Instagram carousel cards (1080 × 1350)`),
162
+ row("carousel/", `${res.carousel.length} cards (1080 × 1350) for an Instagram carousel or a LinkedIn image post`),
163
163
  ...zipNames.map((z) => row(z, `all the ${z.includes("story") ? "story" : "carousel"} cards in one file`)),
164
- row(path.basename(res.pdf), "LinkedIn document post"),
164
+ row(path.basename(res.pdf), "the same cards as a swipeable LinkedIn document (optional)"),
165
165
  row(path.basename(res.xCard), "X post"),
166
166
  "",
167
167
  " Next",
@@ -58,16 +58,27 @@ export async function renderAll(opts) {
58
58
  fs.chmodSync(path.join(opts.infoDir ?? opts.outDir, "render.json"), 0o600); // also when the file already existed
59
59
  return out;
60
60
  }
61
- /** One carousel card per page at its pixel size — LinkedIn renders PDFs as swipeable documents. */
61
+ /** Points per pixel: a 1080 × 1350 px card becomes an 810 × 1012.5 pt page (11.25 × 14.06 in at 96 dpi), the size design tools export for LinkedIn. */
62
+ export const PDF_SCALE = 0.75;
63
+ /**
64
+ * One carousel card per page. LinkedIn shows a PDF document post as a swipeable carousel.
65
+ * Kept deliberately plain so LinkedIn's document processing accepts it: a classic cross-reference
66
+ * table instead of compressed object streams, ordinary page sizes, and full-resolution images.
67
+ */
62
68
  export async function carouselPdf(pngs, year, tool = "Claude Code") {
63
69
  const doc = await PDFDocument.create();
64
- doc.setTitle(`My ${year} with ${tool} — wrapt`);
70
+ const title = `My ${year} with ${tool}`;
71
+ doc.setTitle(title);
72
+ doc.setSubject(`${title}, made with wrapt`);
65
73
  doc.setCreator("wrapt");
66
74
  doc.setProducer("wrapt");
75
+ doc.setLanguage("en");
67
76
  for (const png of pngs) {
68
77
  const img = await doc.embedPng(png);
69
- const page = doc.addPage([img.width, img.height]);
70
- page.drawImage(img, { x: 0, y: 0, width: img.width, height: img.height });
78
+ const w = img.width * PDF_SCALE;
79
+ const h = img.height * PDF_SCALE;
80
+ const page = doc.addPage([w, h]);
81
+ page.drawImage(img, { x: 0, y: 0, width: w, height: h });
71
82
  }
72
- return doc.save();
83
+ return doc.save({ useObjectStreams: false });
73
84
  }
@@ -96,8 +96,8 @@ export function sharePage(a, o) {
96
96
 
97
97
  ${a.carousel.length
98
98
  ? `<div class="wrap">
99
- <h2>Carousel post</h2>
100
- <p>4:5 cards for an Instagram carousel.</p>
99
+ <h2>Instagram carousel &amp; LinkedIn</h2>
100
+ <p>4:5 cards. Post all ${a.carousel.length} as an Instagram carousel, or as a LinkedIn image post.</p>
101
101
  <div class="actions"><button class="btn secondary" id="save-carousel" data-set="carousel">Save all ${a.carousel.length} carousel cards</button></div>
102
102
  <div class="hint" id="hint-carousel"></div>
103
103
  <div class="grid">${a.carousel.map((r, i) => card(r, i, "carousel")).join("")}
@@ -107,8 +107,11 @@ ${a.carousel.length
107
107
 
108
108
  <div class="wrap">
109
109
  ${a.pdf
110
- ? `<h2>LinkedIn document</h2>
111
- <p>All eight carousel cards in one PDF, one per page.</p>
110
+ ? `<h2>LinkedIn</h2>
111
+ <p><b>Easiest:</b> post the ${a.carousel.length} carousel cards as an image post. LinkedIn shows them as a grid that opens into a swipeable viewer.</p>
112
+ ${a.carousel.length ? `<div class="actions"><button class="btn secondary" id="save-linkedin" data-set="carousel" data-hint="linkedin">Save all ${a.carousel.length} for LinkedIn</button></div>
113
+ <div class="hint" id="hint-linkedin"></div>` : ""}
114
+ <p><b>Swipeable in the feed:</b> post the same cards as one PDF document. It takes a few more steps on LinkedIn.</p>
112
115
  <div class="actions"><a class="btn secondary" href="${esc(dl(a.pdf))}" download>Download linkedin.pdf</a></div>`
113
116
  : ""}
114
117
  ${a.xCard
@@ -122,7 +125,8 @@ ${a.carousel.length
122
125
  <ol>
123
126
  <li><b>Instagram Story.</b> Post the 8 story cards in order as one story. On the last card, add a <b>link sticker</b> with ${esc(SITE_URL)} so people can tap through and make their own. Afterwards, add them to a Highlight called “${o.year}” so they stay on your profile.</li>
124
127
  <li><b>Instagram carousel.</b> New post → select multiple → choose carousel cards 01–08 in order. The 4:5 size fills the feed. Put ${esc(SITE)} in your bio, since links in captions can't be tapped.</li>
125
- <li><b>LinkedIn.</b> Start a post → “Add a document” → upload linkedin.pdf and give it a title. It shows as a swipeable carousel.</li>
128
+ <li><b>LinkedIn, easiest.</b> Start a post → add photos → pick the ${a.carousel.length} carousel cards in order → add the caption below → Post.</li>
129
+ <li><b>LinkedIn, swipeable.</b> Start a post → “Add a document” → upload linkedin.pdf → give it a title → Post. It shows as a carousel people swipe in the feed.</li>
126
130
  <li><b>X.</b> Attach x-card.png to a post.</li>
127
131
  </ol>
128
132
 
@@ -154,7 +158,7 @@ ${a.carousel.length
154
158
  var ua = navigator.userAgent;
155
159
  var iOS = /iPhone|iPad|iPod/.test(ua) || (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
156
160
 
157
- function hint(name, html) {
161
+ function showHint(name, html) {
158
162
  var el = document.getElementById("hint-" + name);
159
163
  if (el) { el.innerHTML = html; el.classList.add("show"); }
160
164
  }
@@ -194,6 +198,8 @@ ${a.carousel.length
194
198
  btn.addEventListener("click", async function () {
195
199
  var name = btn.getAttribute("data-set");
196
200
  var urls = sets[name];
201
+ var where = btn.getAttribute("data-hint") || name;
202
+ var hint = function (_, html) { showHint(where, html); };
197
203
  btn.disabled = true;
198
204
  try {
199
205
  // On a phone over HTTPS, the share sheet saves every card straight to Photos in one go.
package/dist/site.js CHANGED
@@ -43,7 +43,7 @@ export function captions(year, tool = "Claude Code") {
43
43
  },
44
44
  {
45
45
  platform: "LinkedIn",
46
- tip: "Paste this as the post text above linkedin.pdf.",
46
+ tip: "Paste this as the post text above your 8 carousel images, or above linkedin.pdf.",
47
47
  text: `My ${year} with ${tool}, in eight cards. wrapt reads your ${tool} history on your own computer ` +
48
48
  `and turns it into a year in review. Nothing is uploaded.\n\nMake yours: ${SITE_URL}`,
49
49
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrapt-cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Your year with Claude Code and GitHub Copilot, wrapped. Share cards made on your own computer.",
5
5
  "license": "MIT",
6
6
  "type": "module",