Skip to content

Add publish-to-pages agent skill#1009

Open
AndreaGriffiths11 wants to merge 2 commits intogithub:mainfrom
AndreaGriffiths11:add-publish-to-pages-skill
Open

Add publish-to-pages agent skill#1009
AndreaGriffiths11 wants to merge 2 commits intogithub:mainfrom
AndreaGriffiths11:add-publish-to-pages-skill

Conversation

@AndreaGriffiths11
Copy link

publish-to-pages

An agent skill that publishes presentations and web content to GitHub Pages. Give it a file (HTML, PPTX, PDF, or Google Slides URL) — get a live URL.

  • Works with any AI coding agent (Copilot CLI, Claude Code, Gemini CLI, etc.)
  • Converts PPTX with full formatting preservation (colors, fonts, images, backgrounds)
  • Creates repo, enables Pages, returns live URL
  • Zero config — just needs gh CLI

Repo: https://github.com/AndreaGriffiths11/publish-to-pages
Landing page: https://andreagriffiths11.github.io/publish-to-pages-site/
Demo: https://andreagriffiths11.github.io/publish-to-pages-site/#how-it-works

@AndreaGriffiths11 AndreaGriffiths11 force-pushed the add-publish-to-pages-skill branch from db1a448 to 2d2b4a8 Compare March 13, 2026 19:14
Agent skill that publishes presentations and web content to GitHub Pages.
Works with any AI coding agent (Copilot CLI, Claude Code, Gemini CLI, etc.)

Features:
- Converts PPTX with full formatting preservation
- Creates repo, enables Pages, returns live URL
- Zero config — just needs gh CLI

Bundled assets:
- scripts/publish.sh - Creates GitHub repo and enables Pages
- scripts/convert-pptx.py - Converts PPTX to HTML with formatting

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AndreaGriffiths11 AndreaGriffiths11 force-pushed the add-publish-to-pages-skill branch from 2d2b4a8 to d501757 Compare March 13, 2026 19:17
@AndreaGriffiths11 AndreaGriffiths11 marked this pull request as ready for review March 13, 2026 19:19
Copilot AI review requested due to automatic review settings March 13, 2026 19:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new publish-to-pages skill intended to let agent workflows convert common presentation formats to HTML and publish the result to a newly-created GitHub Pages site.

Changes:

  • Introduces a bash publisher script that creates a repo, pushes index.html, and enables GitHub Pages.
  • Adds a Python-based PPTX → self-contained HTML converter.
  • Adds SKILL.md instructions describing input detection, conversion, publishing, and error handling.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.

File Description
skills/publish-to-pages/SKILL.md Documents the end-to-end workflow (detect → convert → publish → output URLs).
skills/publish-to-pages/scripts/publish.sh Automates repo creation, commit/push, and Pages enablement.
skills/publish-to-pages/scripts/convert-pptx.py Converts PPTX slides into a self-contained HTML deck for publishing.
Comments suppressed due to low confidence (1)

skills/publish-to-pages/scripts/convert-pptx.py:186

  • Table cell text escaping is incomplete: it escapes & and < but not > (and not quotes). This can break the generated HTML when the PPTX contains those characters. Use a proper HTML escape routine (e.g., html.escape) consistently for all inserted text.
                    for cell in row.cells:
                        cell_text = cell.text.replace("&", "&amp;").replace("<", "&lt;")
                        table_html += f'<td style="border:1px solid #ccc;padding:6px 10px">{cell_text}</td>'
                    table_html += "</tr>"

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +41 to +44
Run the conversion script:
```bash
python3 SKILL_DIR/scripts/convert-pptx.py INPUT_FILE /tmp/output.html
```
Comment on lines +26 to +33
cd "$TMPDIR"
git add index.html
git commit -m "Publish content"
git push origin main

# Enable GitHub Pages
gh api "repos/$USERNAME/$REPO_NAME/pages" -X POST -f source[branch]=main -f source[path]=/ 2>/dev/null || true

Comment on lines +23 to +40
TMPDIR=$(mktemp -d)
git clone "https://github.com/$USERNAME/$REPO_NAME.git" "$TMPDIR"
cp "$HTML_FILE" "$TMPDIR/index.html"
cd "$TMPDIR"
git add index.html
git commit -m "Publish content"
git push origin main

# Enable GitHub Pages
gh api "repos/$USERNAME/$REPO_NAME/pages" -X POST -f source[branch]=main -f source[path]=/ 2>/dev/null || true

echo "REPO_URL=https://github.com/$USERNAME/$REPO_NAME"
echo "PAGES_URL=https://$USERNAME.github.io/$REPO_NAME/"
echo ""
echo "GitHub Pages may take 1-2 minutes to deploy."

# Cleanup
rm -rf "$TMPDIR"
Comment on lines +5 to +13
import io
import re
from pathlib import Path

try:
from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.enum.text import PP_ALIGN
from pptx.dml.color import RGBColor
Comment on lines +220 to +234
title = "Presentation"
# Try to get title from first slide
if prs.slides:
for shape in prs.slides[0].shapes:
if hasattr(shape, "text") and shape.text.strip() and len(shape.text.strip()) < 150:
title = shape.text.strip()
break

html = f'''<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{title}</title>
<style>
Comment on lines +37 to +39
### HTML
No conversion needed. Use the file directly as `index.html`.

fi

# Create repo
gh repo create "$REPO_NAME" --"$VISIBILITY" --description "$DESCRIPTION"
cp "$HTML_FILE" "$TMPDIR/index.html"
cd "$TMPDIR"
git add index.html
git commit -m "Publish content"
Comment on lines +25 to +26
cp "$HTML_FILE" "$TMPDIR/index.html"
cd "$TMPDIR"
- Add convert-pdf.py: renders PDF pages as images, base64-embeds into self-contained HTML with slide navigation
- Replace pandoc dependency with poppler-utils (pdftoppm)
- Add JS transform scale for mobile viewports on PPTX converter
- Update SKILL.md with PDF conversion instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants