Add publish-to-pages agent skill#1009
Open
AndreaGriffiths11 wants to merge 2 commits intogithub:mainfrom
Open
Conversation
db1a448 to
2d2b4a8
Compare
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>
2d2b4a8 to
d501757
Compare
Contributor
There was a problem hiding this comment.
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.mdinstructions 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("&", "&").replace("<", "<")
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
ghCLIRepo: 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