跳过主要内容
G

dsh-html-paper-figures

gongkddz/dsh-html-paper-figures

注册 html-paper-figures 技能,用 HTML/CSS 与内联 SVG 绘制论文数据插图,再经 Playwright 与 Python 后处理,按声明的插入宽度导出 SVG、600 dpi PNG 与矢量 PDF。

安装

dsh plugin --profile web add github:gongkddz/dsh-html-paper-figures

README

dsh-html-paper-figures

A DeepSeek Harness plugin that adds the html-paper-figures skill to every session in the profile.

The skill turns a source data table into a publication-ready figure: a fixed-size HTML canvas with native inline SVG, exported to SVG, a 600 dpi PNG and a vector PDF at the declared insert width, with a check pass for minimum font size, text outside the canvas and collision candidates.

Install

From the plugin market (DSH 0.2.1+ opens Settings → Plugins), or from a terminal:

dsh plugin add github:Gongkddz/dsh-html-paper-figures#v1.0.0

The installed package also answers to a local directory or a GitHub Release tarball (dsh-html-paper-figures.tgz).

Rendering dependencies

Installed once, inside the skill directory:

cd <profile>/node_modules/dsh-html-paper-figures/assets/html-paper-figures
npm ci && npx playwright install chromium
pip install pillow pypdf

A global Playwright (npm i -g playwright) or a system Chrome/Edge passed with --browser also works; the scripts probe skill directory, working directory, NODE_PATH, then the npm global root, and name what is missing when nothing resolves.

What it ships

index.js                        reads SKILL.md and registers the skill
cordis.patch.yml                inserts the plugin row
assets/html-paper-figures/
  SKILL.md                      entry point
  references/
    figure-meaning.md           what the figure must prove, and where it stops
    visual-style.md             palette, type sizes, stroke widths, layout
    render-and-check.md         dependency probe, render commands, acceptance
  scripts/
    render_figure.cjs           Playwright export: SVG, PNG, PDF, *.render.json
    finalize_exports.py         PNG DPI, PDF page size, 96/180 dpi previews
  assets/
    style-specimen.html         runnable example
    style-specimen.png          its rendered output

No model tools, no network calls from the plugin itself. Playwright and Pillow are used only when you run an export.

Verified numbers

The bundled specimen renders at 160 mm with a 9.07 pt minimum font size, no text outside the canvas, a 3780 px wide 600 dpi PNG, and a single-page 160.0 × 98.7 mm PDF whose text stays extractable.

License

MIT. The skill text, scripts and specimen are the author's own work; they are packaged here unchanged.

相关插件