SuperAPI AI Directory

lov-table2image

Office & productivity

View repository

Updated 10-19 11:38

About this skill

Table to Image · Table to Image

Send a standard Markdown table to the Mable server for adaptive layout and PNG rendering, and receive a stable image URL; when a local file is needed, the PNG can be downloaded and verified in the same call.

Triggers

Activate when

  • The user says "convert this Markdown table to an image", "give me a mobile-adaptive table image" or "return the table image URL".
  • The user provides a Markdown table and asks to reuse a Mable model or custom layout parameters.
  • The user asks to “convert this table to an image”, “render a Markdown table as PNG”, or “return a hosted table image URL”.

Do not activate when

  • The user needs evidence charts, conclusion relationships or consulting Exhibits: use lov-professional-infographic。
  • The user needs a general editorial card, poster or AI image generation: use lov-gen-card or lov-image-creator。
  • The user only needs to edit table text, compute data or export XLSX; this Skill is not triggered.

User Profile (cross-session)

Before running, read skill.yaml and the shared user-profile/v1. The resolution order is: current request, project context,skills.lov-table2image.records, shared preferences, shared brand/user, safe defaults.

The API root address is resolved in the order of --api-base、MABLE_API_BASE, the Skill Profile record, https://api.lovstudio.ai . When the user directly declares a long-term API root address, default model or output preference, save it via scripts/profile_store.py record --confirm and report the Profile path. Do not save credentials, one-off table content or returned temporary error information.

Skill Group Composition

Read references/skill-composition.mdfirst. Adjacent Skills hand off only through Markdown, PNG or URL artifacts and do not constitute hidden runtime dependencies.

Required resources

Before running, confirm:

  • $SKILL_DIR/scripts/table2image.py
  • $SKILL_DIR/references/api-contract.md
  • $SKILL_DIR/references/skill-composition.md

Workflow (MANDATORY)

Step 0: Resolve runtime context

  • Prefer the SKILL_DIRprovided by the host; otherwise resolve the installation directory from the current Skill context.
  • Read skill.yaml and the Profile, but do not write the resolved private paths into reusable source code or examples.
  • Check Python 3.9+,MABLE_API_TOKEN and Mable API reachability; do not start, deploy or modify the remote service yourself.

Step 1: Validate the table input

  • The input must be a standard Markdown table with a header row, a separator row and at least one data row.
  • Preserve the user's original cell text, alignment markers and line-break intent; do not summarize, translate or add data on your own.
  • --model accepts an 11-character URL-safe Mable model;--layout-json accepts a JSON file or inline JSON, and only one of the two may be chosen.
  • When the user does not provide a layout, omit the relevant parameters and let the server use the default layout.

Step 2: Render through Mable

First provide the LovStudio Access Token via an environment variable or sk_live_* API Key:

export MABLE_API_TOKEN="<LovStudio token>"

POST /mable/images Each successful generation deducts 3 Credits; image reads are not charged again. Credentials are provided only via environment variables or a one-off --token parameter, and must not be written into the Profile, logs or reusable artifacts.

Generate a hosted image URL from a file:

python3 "$SKILL_DIR/scripts/table2image.py" ./table.md

Reuse a layout model and download the PNG:

python3 "$SKILL_DIR/scripts/table2image.py" ./table.md \
  --model Asge8oUog7I \
  --output ./table.png

Pass the table via standard input and use the full layout parameters:

python3 "$SKILL_DIR/scripts/table2image.py" - \
  --layout-json ./layout.json

The default caption is the Mable server's brand description. Use --caption "" to hide it, or pass a custom description. See references/api-contract.md。

Step 3: Verify and report

  • The command must return JSON containing at least image_url、format、width、height、 layout_width、model、credits_spent and credits_remaining。
  • When --output is specified, you must also check that the response is a PNG, that the file starts with the PNG signature and is non-empty; append the absolute output_path and bytes。
  • Return clickable image addresses to the user first; when a local file is requested, also return the file path, pixels, and model.
  • HTTP errors must retain the status code and a summary of the server response; do not describe a failure as generated.

Output contract

  • Core result: a stable PNG URL returned by the Mable API.
  • Metadata: PNG format, actual pixel dimensions, layout width, and the 11-digit model used.
  • Optional result: a verified local PNG file and its byte count.
  • Do not return or disclose the server-side layout algorithm, database records, or internal deployment information.

Cloud boundary

The Skill is the transport layer; the server owns layout solving, font fitting, rendering, and content-addressed persistence. The client only sends the table and the optional parameters explicitly provided by the user, and receives the image address and the necessary display metadata. The output contains no intermediate scores, search traces, or algorithm explanations, so the server-side layout logic cannot be reconstructed from call logs.

Dependencies

  • Python 3.9+; the script uses only the standard library.
  • An accessible Mable API; the default root address is https://api.lovstudio.ai。
  • LovStudio Access Token or sk_live_* API Key; each successful generation costs 3 Credits.
  • No external sibling Skill, browser, or local fonts are required.