From telegraph-publisher
Publishes HTML content with images, YouTube embeds, and diagrams to Telegraph via API. Auto-splits long articles and hosts media on GitHub using bash/Python scripts.
npx claudepluginhub artwist-polyakov/polyakov-claude-skills --plugin telegraph-publisherThis skill uses the workspace's default tool permissions.
Publish content to Telegraph via API with media support.
config/README.mdreferences/CONTENT_FORMAT.mdreferences/DIAGRAMS.mdreferences/FAL_AI_INTEGRATION.mdreferences/IMAGE_WORKFLOWS.mdreferences/YOUTUBE_EMBEDS.mdscripts/account_info.shscripts/common.shscripts/content_converter.pyscripts/create_account.shscripts/create_page.shscripts/diagram_encode.pyscripts/edit_page.shscripts/github_delete_page_assets.shscripts/github_manifest.pyscripts/github_upload.shscripts/list_pages.shscripts/parse_response.pyscripts/render_diagram.shscripts/upload.shGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Publish content to Telegraph via API with media support. Best for: articles, research reports, documentation, illustrated content.
config/.envcreate_account.sh first if no token existsNo token? → sh scripts/create_account.sh --name "Name"
Have token? → Save to config/.env
Publish page? → sh scripts/create_page.sh --title "Title" --html "<p>Content</p>"
Edit page? → sh scripts/edit_page.sh --path "Path-03-09" --title "Title" --html "<p>New</p>"
List pages? → sh scripts/list_pages.sh
Account info? → sh scripts/account_info.sh
Permanent media? → sh scripts/github_upload.sh --file hero.webp --page-path page-path
Telegraph accounts are API-only (no password/email). Key concepts:
create_account.sh generates access_token + one-time auth_urlauth_url in browser to bind API account to browser sessioncreatePage--revoke to rotate token if compromisedSee config/README.md for full ownership model.
Scripts are POSIX sh compatible — work in cloud sandboxes (/bin/sh) and locally.
Python scripts use stdlib only (html.parser, json, sys).
Requires TELEGRAPH_ACCESS_TOKEN in config/.env or environment.
For permanent media hosting, prefer a separate public GitHub repo + jsDelivr CDN. Reason: Telegraph's unofficial upload endpoint is unstable and should not be the default publishing path.
The agent should assume this is the default permanent media backend.
Required GitHub config:
GITHUB_TOKEN=ghp_...
GITHUB_ASSETS_REPO=owner/repo
GITHUB_ASSETS_BRANCH=main
GITHUB_ASSETS_BASE_DIR=pages
GITHUB_MANIFESTS_DIR=manifests
Recommended setup:
Contents: Read and writeconfig/.envWhy this matters:
Agent rule:
upload.sh only as a legacy fallbackTelegraph API accepts an array of Node objects. This skill converts HTML fragments to Node JSON automatically.
Supported HTML tags (Telegraph API whitelist):
a, aside, b, blockquote, br, code, em, figcaption, figure, h3, h4, hr, i, iframe, img, li, ol, p, pre, s, strong, u, ul, video
Only href and src attributes are preserved. Unsupported tags are stripped (children kept).
Special case:
table, thead, tr, th, td) are converted into a monospace pre blockSee references/CONTENT_FORMAT.md for Node format details.
sh scripts/create_account.sh --name "Author Name" [--author-url "https://..."]
sh scripts/create_account.sh --revoke # rotate token
sh scripts/account_info.sh
sh scripts/account_info.sh --with-auth-url # include auth_url in output
# From HTML string
sh scripts/create_page.sh --title "Article" --html "<h3>Hello</h3><p>World</p>"
# From HTML file
sh scripts/create_page.sh --title "Article" --html-file article.html
# From pre-built Node JSON
sh scripts/create_page.sh --title "Article" --content-file nodes.json
# With author info
sh scripts/create_page.sh --title "Article" --html-file a.html --author-name "Name"
| Param | Required | Description |
|---|---|---|
--title | yes | Page title (1-256 chars) |
--html | one of three | Inline HTML string |
--html-file | one of three | Path to HTML file |
--content-file | one of three | Path to Node JSON file |
--author-name | no | Author name (0-128 chars) |
--author-url | no | Author profile URL |
Auto-split: If content exceeds 60KB, automatically splits into multiple pages with an index page linking to parts.
sh scripts/edit_page.sh --path "Page-Title-03-09" --title "Updated Title" --html "<p>New content</p>"
| Param | Required | Description |
|---|---|---|
--path | yes | Page path (from URL or create output) |
--title | yes | Page title |
--html / --html-file / --content-file | yes | New content |
--author-name | no | Author name |
--author-url | no | Author URL |
sh scripts/list_pages.sh
sh scripts/list_pages.sh --offset 0 --limit 20
Upload local media to the GitHub assets repo and update page manifest:
sh scripts/github_upload.sh --file ./hero.webp --page-path my-page-path
sh scripts/github_upload.sh --file ./diagram.png --page-path my-page-path --name diagram-01.png
| Param | Required | Description |
|---|---|---|
--file | yes | Local asset file |
--page-path | yes | Telegraph page path used as manifest/asset key |
--name | no | Override stored filename in GitHub |
Output: commit-pinned jsDelivr URL.
Manifest behavior:
pages/<telegraph_path>/...manifests/<telegraph_path>.jsonDelete all GitHub-backed assets for a page using its manifest:
sh scripts/github_delete_page_assets.sh --page-path my-page-path
| Param | Required | Description |
|---|---|---|
--page-path | yes | Telegraph page path |
Cleanup rule:
path as the stable page identifierLegacy fallback for local image/video upload to Telegraph:
# Best-effort only
URL=$(sh scripts/upload.sh --file /path/to/photo.jpg)
# Use in HTML
echo "<figure><img src=\"$URL\"><figcaption>My photo</figcaption></figure>"
| Param | Required | Description |
|---|---|---|
--file | yes | Path to image/video (jpg, png, gif, webp, mp4; max 5MB) |
--insecure | no | Skip SSL verification (for HTTPS-intercepting proxies/VPNs) |
Note: Uses unofficial telegra.ph/upload endpoint. Do not treat it as the primary workflow. Best-effort only — may fail behind corporate proxies/VPNs or without any obvious reason.
Render PlantUML/Mermaid diagrams via public servers:
# Get render URL (image on public server)
sh scripts/render_diagram.sh --type plantuml --file arch.puml
# Render + upload to GitHub-backed permanent media
sh scripts/render_diagram.sh --type mermaid --file flow.mmd --github-page-path my-page-path --github-name cohort.png
# Legacy fallback: render + upload via Telegraph upload
sh scripts/render_diagram.sh --type mermaid --file flow.mmd --upload
| Param | Required | Description |
|---|---|---|
--type | yes | plantuml or mermaid |
--file | yes | Path to diagram source file |
--github-page-path | no | Upload rendered file to GitHub assets under this Telegraph path |
--github-name | no | Override GitHub filename for rendered asset |
--upload | no | Legacy fallback: download rendered PNG and upload to Telegraph |
Privacy: Diagram source is sent to plantuml.com / mermaid.ink. Do not use for confidential content.
# HTML → Node JSON
echo '<p>Hello <b>world</b></p>' | python3 scripts/content_converter.py
# Check serialized size (bytes)
cat nodes.json | python3 scripts/content_converter.py --check-size
# Split large content
cat nodes.json | python3 scripts/content_converter.py --split --output-dir /tmp/parts
Preferred workflow: upload local files to a dedicated public GitHub assets repo and serve them via jsDelivr.
Why GitHub is worth connecting:
Fallback workflow: use upload.sh only when GitHub-backed hosting is unavailable.
Recommended asset lifecycle:
pathpages/<telegraph_path>/... via github_upload.shgithub_delete_page_assets.sh --page-path <telegraph_path>Agent decision rule:
upload.sh can be used as fallbackgithub_delete_page_assets.shDo not key cleanup only by page title. Titles can change. Use Telegraph path as the primary page identifier.
If a two-pass draft flow is not available, use a temporary page key and persist a manifest mapping:
telegraph_path -> github asset paths.
Legacy fallback: upload local files or use public URLs:
# Local file → Telegraph URL
URL=$(sh scripts/upload.sh --file photo.jpg)
Then embed in HTML:
<figure>
<img src="https://telegra.ph/file/abc123.jpg">
<figcaption>Photo caption</figcaption>
</figure>
See references/IMAGE_WORKFLOWS.md for workflows.
YouTube URLs are automatically normalized to embed format:
<figure>
<iframe src="https://www.youtube.com/watch?v=VIDEO_ID"></iframe>
</figure>
The converter transforms watch?v= and youtu.be/ URLs to /embed/ format.
See references/YOUTUBE_EMBEDS.md for details.
Preferred workflow: render PlantUML/Mermaid, store the image in GitHub assets, then publish jsDelivr URL.
Legacy fallback: render PlantUML/Mermaid to image and upload:
# Preferred: render + GitHub upload
URL=$(sh scripts/render_diagram.sh --type plantuml --file arch.puml --github-page-path my-page-path --github-name arch.png)
# Legacy fallback
URL=$(sh scripts/render_diagram.sh --type plantuml --file arch.puml --upload)
See references/DIAGRAMS.md for details and privacy considerations.
Telegraph does not support real HTML tables as native nodes. This skill handles that by converting input HTML tables into a readable monospace pre block.
Use tables when:
Use diagrams when:
Mobile-first rule:
pre tables for wide tables with 3+ dense columns or long labelsExample input:
<table>
<thead>
<tr><th>Домен</th><th>Расход, руб.</th></tr>
</thead>
<tbody>
<tr><td>metallik.ru</td><td>82 900</td></tr>
<tr><td>mir-shtaketnika.ru</td><td>38 367</td></tr>
</tbody>
</table>
This will be published as a boxed monospace table inside a pre block.
If the fal-ai-image skill is installed, you can generate illustrations before publishing:
<figure><img src="URL"></figure>create_page.shSee references/FAL_AI_INTEGRATION.md for house style guide and prompt examples.
Important: telegraph-publisher works fully without fal-ai-image. This is an optional enhancement.
upload.sh uses unofficial Telegraph endpoint and should be treated as legacy fallback only