Index of every page on this site: llms.txt
All skills
wghust avatar

/insight-pdf

@e591e3f
by wghustwghust/stark-skills5 stars
Run it yourself

Generates professional corporate/business report PDFs from text or Markdown via HTML. Uses ECharts for advanced visualizations (heatmaps, radar, gauge, sankey), rich design system (gradient covers, stat cards, callout boxes, progress bars, timelines), and professional typography. Use when the user wants enterprise-quality report PDFs with modern data storytelling.

Use this Skill: https://skilld.dev/gh/wghust/stark-skills/insight-pdf

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

USAGE.md

≈502 tokens on demand. Your agent reads this file only when SKILL.md points to it.

insight-pdf 使用说明

从 Markdown/文本思路生成企业风 PDF:Agent 按 reference.md 与 templates/insight-report.html 拼 HTML,再调用 scripts/convert.js 输出 仅 PDF 到用户指定路径(用户项目不留 HTML/node_modules)。


前置条件

  • Node.js 18+(建议 LTS)
  • 转换时若使用默认模板:可访问外网(jsDelivr、Google Fonts),见 SKILL.md「网络与模板依赖」

安装(始终在 skill 目录,不要在用户业务项目里装依赖)

cd skills/insight-pdf   # 或 ~/.cursor/skills/insight-pdf
npm install

安装脚本会尝试下载 Chromium。若报错「Executable doesn't exist」或缺少浏览器:

npx playwright install chromium

生成 PDF

  1. 生成完整 HTML(替换模板中的 {{REPORT_TITLE}}、{{REPORT_BODY}}、{{CHARTS_SECTION}} 等占位符)。
  2. 将 HTML 存到临时路径,调用(skill 路径请用绝对路径):
node /path/to/skills/insight-pdf/scripts/convert.js /tmp/your-report.html /path/to/output/report.pdf

convert.js 会 自动创建 PDF 父目录(若不存在)。HTML 路径与 PDF 路径均支持相对或绝对路径;内部使用 pathToFileURL,Windows 与含空格路径可正常加载 file://。


常见问题

Chromium 未安装
在 skill 目录执行:npm install && npx playwright install chromium。

超时或图表空白
多为 CDN/网络不可达。处理:保证联网;或修改模板改为本地/内网静态资源后再转换。

内网/离线
必须去掉或替换模板中对 cdn.jsdelivr.net、fonts.googleapis.com 的引用,否则 load 可能长时间等待或失败。

与用户项目的关系
依赖与浏览器仅在 skill 目录;用户仓库里通常只增加一个 .pdf 文件。


设计参考

配色、组件 HTML 片段见 reference.md;完整页面骨架见 templates/insight-report.html。

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning7mo4 checks · Risk SAFE
  • Gen Agent Trust Hub7mo

    The insight-pdf skill provides a professional PDF generation workflow using Playwright and ECharts. It uses trusted dependencies from Microsoft and Google and follows secure practices such as using temporary directories for intermediate files and cleaning up after processing. All external downloads and resources originate from well-known and reputable providers.

  • Socket7mo

    No alerts

  • Snyk7mo

    Risk: MEDIUM · 1 issue

  • Runlayer8mo

    6 files scanned · No issues

Signed by skilld at e591e3f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 weeks ago.

Dormantupdated 8 months ago

README badge

README badge for wghust/stark-skills/insight-pdf