mulmocast 1.2.25 → 1.2.26

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/lib/mcp/aaa.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ process.env.DOTENV_CONFIG_QUIET = 'true';
3
+ import dotenv from "dotenv";
4
+ dotenv.config();
package/lib/mcp/server.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ process.env.DOTENV_CONFIG_QUIET = 'true';
2
3
  import "dotenv/config";
3
4
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
4
5
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -11,12 +11,22 @@ export const renderHTMLToImage = async (html, outputPath, width, height, isMerma
11
11
  await page.setContent(html);
12
12
  // Adjust page settings if needed (like width, height, etc.)
13
13
  await page.setViewport({ width, height });
14
+ await page.addStyleTag({ content: "html,body{margin:0;padding:0;overflow:hidden}" });
14
15
  if (isMermaid) {
15
16
  await page.waitForFunction(() => {
16
17
  const el = document.querySelector(".mermaid");
17
18
  return el && el.dataset.ready === "true";
18
19
  }, { timeout: 20000 });
19
20
  }
21
+ // Measure the size of the page and scale the page to the width and height
22
+ await page.evaluate(({ vw, vh }) => {
23
+ const de = document.documentElement;
24
+ const sw = Math.max(de.scrollWidth, document.body.scrollWidth || 0);
25
+ const sh = Math.max(de.scrollHeight, document.body.scrollHeight || 0);
26
+ const scale = Math.min(vw / (sw || vw), vh / (sh || vh), 1); // <=1 で縮小のみ
27
+ de.style.overflow = "hidden";
28
+ document.body.style.zoom = String(scale);
29
+ }, { vw: width, vh: height });
20
30
  // Step 3: Capture screenshot of the page (which contains the Markdown-rendered HTML)
21
31
  await page.screenshot({ path: outputPath, omitBackground });
22
32
  await browser.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "1.2.25",
3
+ "version": "1.2.26",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",