publish-to-pages by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill publish-to-pages一键将任何演示文稿或网页内容发布到 GitHub Pages。
静默运行以下命令。仅显示错误信息:
command -v gh >/dev/null || echo "MISSING: gh CLI — install from https://cli.github.com"
gh auth status &>/dev/null || echo "MISSING: gh not authenticated — run 'gh auth login'"
command -v python3 >/dev/null || echo "MISSING: python3 (needed for PPTX conversion)"
poppler-utils 是可选的(用于通过 pdftoppm 转换 PDF)。不要因此阻塞流程。
根据用户提供的内容确定输入类型:
| 输入 | 检测方式 |
|---|---|
| HTML 文件 | 扩展名为 .html 或 .htm |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| PPTX 文件 | 扩展名为 .pptx |
| PDF 文件 | 扩展名为 .pdf |
| Google Slides URL | URL 包含 docs.google.com/presentation |
如果未提供,则向用户询问仓库名称。默认值:不带扩展名的文件名。
两个转换脚本都会自动检测大文件并切换到外部资源模式:
assets/ 目录下的独立文件assets/ 目录下这确保了单个文件大小远低于 GitHub 的 100MB 限制。小文件仍会生成单个自包含的 HTML 文件。
你可以使用 --external-assets 或 --no-external-assets 强制指定此行为。
无需转换。直接使用该文件作为 index.html。
运行转换脚本:
python3 SKILL_DIR/scripts/convert-pptx.py INPUT_FILE /tmp/output.html
# 对于大文件,强制使用外部资源:
python3 SKILL_DIR/scripts/convert-pptx.py INPUT_FILE /tmp/output.html --external-assets
如果缺少 python-pptx,告知用户:pip install python-pptx
使用包含的脚本进行转换(需要 poppler-utils 以使用 pdftoppm):
python3 SKILL_DIR/scripts/convert-pdf.py INPUT_FILE /tmp/output.html
# 对于大文件,强制使用外部资源:
python3 SKILL_DIR/scripts/convert-pdf.py INPUT_FILE /tmp/output.html --external-assets
每一页都会被渲染为 PNG 图片,并嵌入到带有幻灯片导航的 HTML 中。如果缺少 pdftoppm,告知用户:apt install poppler-utils(或在 macOS 上使用 brew install poppler)。
/d/ 和 / 之间的长字符串)curl -L "https://docs.google.com/presentation/d/PRESENTATION_ID/export/pptx" -o /tmp/slides.pptx
默认情况下,仓库被创建为公开。如果用户指定 private(或想要一个私有仓库),请使用 --private —— 但请注意,私有仓库上的 GitHub Pages 需要 Pro、Team 或 Enterprise 计划。
bash SKILL_DIR/scripts/publish.sh /path/to/index.html REPO_NAME public "Description"
如果用户要求,传递 private 而不是 public。
该脚本会创建仓库,推送 index.html(以及 assets/ 目录,如果存在),并启用 GitHub Pages。
注意: 当使用外部资源模式时,输出的 HTML 会引用 assets/ 中的文件。发布脚本会自动检测并将 assets/ 目录与 HTML 文件一起复制。请确保 HTML 文件及其 assets/ 目录位于同一个父目录中。
告知用户:
https://github.com/USERNAME/REPO_NAMEhttps://USERNAME.github.io/REPO_NAME/my-slides-2)或日期(my-slides-2026)。pip install python-pptx。poppler-utils(apt install poppler-utils 或 brew install poppler)。每周安装量
302
仓库
GitHub 星标数
26.7K
首次出现
8 天前
安全审计
安装于
gemini-cli278
codex277
opencode271
cursor269
github-copilot268
cline267
Publish any presentation or web content to GitHub Pages in one shot.
Run these silently. Only surface errors:
command -v gh >/dev/null || echo "MISSING: gh CLI — install from https://cli.github.com"
gh auth status &>/dev/null || echo "MISSING: gh not authenticated — run 'gh auth login'"
command -v python3 >/dev/null || echo "MISSING: python3 (needed for PPTX conversion)"
poppler-utils is optional (PDF conversion via pdftoppm). Don't block on it.
Determine input type from what the user provides:
| Input | Detection |
|---|---|
| HTML file | Extension .html or .htm |
| PPTX file | Extension .pptx |
| PDF file | Extension .pdf |
| Google Slides URL | URL contains docs.google.com/presentation |
Ask the user for a repo name if not provided. Default: filename without extension.
Both conversion scripts automatically detect large files and switch to external assets mode :
assets/assets/This keeps individual files well under GitHub's 100MB limit. Small files still produce a single self-contained HTML.
You can force the behavior with --external-assets or --no-external-assets.
No conversion needed. Use the file directly as index.html.
Run the conversion script:
python3 SKILL_DIR/scripts/convert-pptx.py INPUT_FILE /tmp/output.html
# For large files, force external assets:
python3 SKILL_DIR/scripts/convert-pptx.py INPUT_FILE /tmp/output.html --external-assets
If python-pptx is missing, tell the user: pip install python-pptx
Convert with the included script (requires poppler-utils for pdftoppm):
python3 SKILL_DIR/scripts/convert-pdf.py INPUT_FILE /tmp/output.html
# For large files, force external assets:
python3 SKILL_DIR/scripts/convert-pdf.py INPUT_FILE /tmp/output.html --external-assets
Each page is rendered as a PNG and embedded into HTML with slide navigation. If pdftoppm is missing, tell the user: apt install poppler-utils (or brew install poppler on macOS).
/d/ and /)curl -L "https://docs.google.com/presentation/d/PRESENTATION_ID/export/pptx" -o /tmp/slides.pptx
Repos are created public by default. If the user specifies private (or wants a private repo), use --private — but note that GitHub Pages on private repos requires a Pro, Team, or Enterprise plan.
bash SKILL_DIR/scripts/publish.sh /path/to/index.html REPO_NAME public "Description"
Pass private instead of public if the user requests it.
The script creates the repo, pushes index.html (plus assets/ if present), and enables GitHub Pages.
Note: When external assets mode is used, the output HTML references files in assets/. The publish script automatically detects and copies the assets/ directory alongside the HTML file. Make sure the HTML file and its assets/ directory are in the same parent directory.
Tell the user:
https://github.com/USERNAME/REPO_NAMEhttps://USERNAME.github.io/REPO_NAME/my-slides-2) or a date (my-slides-2026).pip install python-pptx.poppler-utils (apt install poppler-utils or brew install poppler).Weekly Installs
302
Repository
GitHub Stars
26.7K
First Seen
8 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli278
codex277
opencode271
cursor269
github-copilot268
cline267
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
102,600 周安装