ghost-paper 0.3.3 → 0.3.4

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.
@@ -2,7 +2,7 @@ import {
2
2
  build,
3
3
  buildPdf,
4
4
  buildPrintHtml
5
- } from "./chunk-BYWWJNGV.js";
5
+ } from "./chunk-NWFECGNX.js";
6
6
  export {
7
7
  build,
8
8
  buildPdf,
@@ -971,6 +971,20 @@ var CSS = `
971
971
  color: var(--text-primary);
972
972
  }
973
973
 
974
+ /* Row-level tinting: charcoal = confirmed, chartreuse = forward-looking */
975
+ .tab-content tbody tr.row-actual td {
976
+ background: #E8E7E3;
977
+ }
978
+ .tab-content tbody tr.row-baseline td {
979
+ background: #F1F3E4;
980
+ }
981
+ .tab-content tbody tr.row-forecast td {
982
+ background: #ECF0DA;
983
+ }
984
+ .tab-content tbody tr.row-stretch td {
985
+ background: #E8EDCF;
986
+ }
987
+
974
988
  hr.pagebreak {
975
989
  border: none;
976
990
  border-top: 1px solid var(--border);
@@ -1268,6 +1282,19 @@ var PRINT_CSS = `
1268
1282
  .tab-content tbody td { padding: 8px 10px; font-weight: 400; border-bottom: 1px solid #E8E8E4; }
1269
1283
  .tab-content tbody tr:last-child td { border-bottom: none; }
1270
1284
 
1285
+ .tab-content tbody tr.row-actual td {
1286
+ background: #E5E4E0;
1287
+ }
1288
+ .tab-content tbody tr.row-baseline td {
1289
+ background: #EFF1E1;
1290
+ }
1291
+ .tab-content tbody tr.row-forecast td {
1292
+ background: #E9EDD7;
1293
+ }
1294
+ .tab-content tbody tr.row-stretch td {
1295
+ background: #E5EACC;
1296
+ }
1297
+
1271
1298
  /* KPIs: compact grid for column width */
1272
1299
  .kpi-strip {
1273
1300
  margin: 12px 0; padding: 8px 0;
@@ -1363,12 +1390,30 @@ ${kpis}
1363
1390
  </div>`;
1364
1391
  }
1365
1392
  function renderTable(table, wide) {
1366
- const thead = table.headers.map((h) => `<th>${escapeHtml3(h)}</th>`).join("");
1393
+ const colCount = table.headers.length;
1394
+ const totalParts = 1.15 + (colCount - 1);
1395
+ const firstPct = (1.15 / totalParts * 100).toFixed(1);
1396
+ const otherPct = (1 / totalParts * 100).toFixed(1);
1397
+ const thead = table.headers.map((h, i) => {
1398
+ const w = i === 0 ? firstPct : otherPct;
1399
+ return `<th style="width:${w}%">${escapeHtml3(h)}</th>`;
1400
+ }).join("");
1367
1401
  const tbody = table.rows.map((row) => {
1402
+ const firstCell = (row[0] || "").toLowerCase();
1403
+ let rowClass = "";
1404
+ if (/baseline/.test(firstCell)) {
1405
+ rowClass = ' class="row-baseline"';
1406
+ } else if (/stretch|\btarget\b/.test(firstCell)) {
1407
+ rowClass = ' class="row-stretch"';
1408
+ } else if (/forecast|projected|plan|budget|estimate/.test(firstCell)) {
1409
+ rowClass = ' class="row-forecast"';
1410
+ } else if (/actual/.test(firstCell)) {
1411
+ rowClass = ' class="row-actual"';
1412
+ }
1368
1413
  const cells = row.map((cell) => {
1369
1414
  return `<td>${escapeHtml3(cell)}</td>`;
1370
1415
  }).join("");
1371
- return `<tr>${cells}</tr>`;
1416
+ return `<tr${rowClass}>${cells}</tr>`;
1372
1417
  }).join("\n ");
1373
1418
  const wideClass = wide || table.headers.length >= 5 ? " table-wide" : "";
1374
1419
  return ` <div class="table-wrap${wideClass}"><table>
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  build
4
- } from "./chunk-BYWWJNGV.js";
4
+ } from "./chunk-NWFECGNX.js";
5
5
 
6
6
  // src/cli.ts
7
7
  import { Command } from "commander";
@@ -90,7 +90,7 @@ buildCmd.command("pdf").description("Convert a markdown file to a PDF report").a
90
90
  const inputPath = resolve(input);
91
91
  const markdown = readFileSync(inputPath, "utf-8");
92
92
  const outputPath = opts.output ? resolve(opts.output) : inputPath.replace(/\.md$/, ".pdf");
93
- const { buildPdf } = await import("./-EDFCYK7D.js");
93
+ const { buildPdf } = await import("./-5C6AORSD.js");
94
94
  await buildPdf(markdown, outputPath, {
95
95
  pageSize: opts.pageSize ?? "A4",
96
96
  landscape: opts.landscape ?? false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghost-paper",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Turn markdown into beautiful HTML reports",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",