-
Notifications
You must be signed in to change notification settings - Fork 172
feat(skills): add 6 PowerPoint skill enhancements #1481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
auyidi1
wants to merge
26
commits into
main
Choose a base branch
from
users/auyidi/pptx-skill-enhancements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
c6285e3
feat(skills): add 6 PowerPoint skill enhancements
8d53657
fix(skills): resolve ruff lint and format violations
333416f
test(skills): add tests for 4 new PowerPoint skill scripts
705b9db
fix(skills): address PR review feedback from katriendg and CI
afea654
Merge branch 'main' into users/auyidi/pptx-skill-enhancements
auyidi1 11b1472
style(skills): fix ruff format on export_svg.py and test_generate_the…
dae25d3
fix(skills): address second round PR review feedback
5c40476
fix(skills): address third round PR review feedback
50ffd86
Merge branch 'main' into users/auyidi/pptx-skill-enhancements
auyidi1 a285e8d
Merge branch 'main' into users/auyidi/pptx-skill-enhancements
auyidi1 7f72e47
fix(skills): address fourth round PR review feedback
f103c6b
fix(skills): address fifth round PR review feedback
c825af3
fix(skills): address sixth round PR review feedback
a665785
fix(skills): address seventh round PR review feedback
94edc90
fix(skills): address eighth round PR review feedback
d85988d
fix(skills): add CmdletBinding and explicit Mandatory to PS1 wrappers
f47ee0e
fix(skills): address ninth round PR review feedback
faba1e7
fix(skills): address PR Review bot findings
c5ae6d3
fix(skills): correct step counts and extract run() in validate_geometry
6e54a0b
fix(skills): support single-quoted hex and fix theme docs
2daa49c
fix(skills): add Exception handler in validate_geometry and use Pasca…
530665e
fix(skills): add .pptx extension check and PS1 convention fixes
8e0cd01
Merge branch 'main' into users/auyidi/pptx-skill-enhancements
auyidi1 059796c
fix(skills): add future annotations to 4 Python scripts and document …
6c7dce5
fix(skills): close fitz.Document via context manager and make --outpu…
656de64
fix(skills): add PyMuPDFError class, fix docstring, document add_movi…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
88 changes: 88 additions & 0 deletions
88
.github/skills/experimental/powerpoint/scripts/Invoke-EmbedAudio.ps1
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| #!/usr/bin/env pwsh | ||
| # Copyright (c) Microsoft Corporation. | ||
| # SPDX-License-Identifier: MIT | ||
| #Requires -Version 7.0 | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Embed WAV audio files into a PowerPoint deck. | ||
|
|
||
| .DESCRIPTION | ||
| Wrapper script that manages the Python virtual environment and invokes | ||
| embed_audio.py to embed per-slide WAV files into a PPTX presentation. | ||
|
|
||
| .PARAMETER InputPath | ||
| Input PPTX file path. | ||
|
|
||
| .PARAMETER AudioDir | ||
| Directory containing slide-NNN.wav files. | ||
|
|
||
| .PARAMETER OutputPath | ||
| Output PPTX file path. | ||
|
|
||
| .PARAMETER Slides | ||
| Comma-separated slide numbers to embed audio on (optional). | ||
|
|
||
| .PARAMETER SkipVenvSetup | ||
| Skip virtual environment setup. | ||
|
|
||
| .PARAMETER Verbose | ||
| Enable verbose output. | ||
|
|
||
| .EXAMPLE | ||
| ./Invoke-EmbedAudio.ps1 -InputPath deck.pptx -AudioDir voice-over/ -OutputPath out.pptx | ||
|
|
||
| .NOTES | ||
| Part of the powerpoint skill. Manages uv virtual environment setup | ||
| and delegates to embed_audio.py for WAV embedding into PPTX slides. | ||
| #> | ||
|
|
||
| [CmdletBinding()] | ||
| param( | ||
|
auyidi1 marked this conversation as resolved.
|
||
| [Parameter(Mandatory = $true)][string]$InputPath, | ||
| [Parameter(Mandatory = $true)][string]$AudioDir, | ||
| [Parameter(Mandatory = $true)][string]$OutputPath, | ||
| [string]$Slides, | ||
| [switch]$SkipVenvSetup | ||
| ) | ||
|
|
||
| $ErrorActionPreference = 'Stop' | ||
|
auyidi1 marked this conversation as resolved.
|
||
|
|
||
| #region Environment Setup | ||
|
|
||
| $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path | ||
| $SkillRoot = Split-Path -Parent $ScriptDir | ||
| $VenvDir = Join-Path $SkillRoot '.venv' | ||
|
|
||
| #endregion Environment Setup | ||
|
|
||
| #region Main | ||
|
|
||
| if ($MyInvocation.InvocationName -ne '.') { | ||
|
|
||
| if (-not $SkipVenvSetup) { | ||
| if (-not (Get-Command uv -ErrorAction SilentlyContinue)) { | ||
| throw 'uv is required but was not found on PATH.' | ||
| } | ||
| uv sync --directory $SkillRoot | ||
| } | ||
|
|
||
| $python = if (Test-Path (Join-Path $VenvDir 'Scripts/python.exe')) { | ||
| Join-Path $VenvDir 'Scripts/python.exe' | ||
| } elseif (Test-Path (Join-Path $VenvDir 'bin/python')) { | ||
| Join-Path $VenvDir 'bin/python' | ||
| } else { | ||
| throw "Python interpreter not found in venv. Run: uv sync --directory `"$SkillRoot`"" | ||
| } | ||
|
|
||
| $script = Join-Path $ScriptDir 'embed_audio.py' | ||
| $ScriptArgs = @($script, '--input', $InputPath, '--audio-dir', $AudioDir, '--output', $OutputPath) | ||
| if ($Slides) { $ScriptArgs += '--slides'; $ScriptArgs += $Slides } | ||
| if ($VerbosePreference -eq 'Continue') { $ScriptArgs += '-v' } | ||
|
|
||
| & $python @ScriptArgs | ||
| exit $LASTEXITCODE | ||
|
|
||
| } | ||
|
|
||
| #endregion Main | ||
84 changes: 84 additions & 0 deletions
84
.github/skills/experimental/powerpoint/scripts/Invoke-ExportSvg.ps1
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| #!/usr/bin/env pwsh | ||
| # Copyright (c) Microsoft Corporation. | ||
| # SPDX-License-Identifier: MIT | ||
| #Requires -Version 7.0 | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Export PowerPoint slides to SVG images. | ||
|
|
||
| .DESCRIPTION | ||
| Wrapper script that manages the Python virtual environment and invokes | ||
| export_svg.py to convert PPTX slides to SVG via LibreOffice and PyMuPDF. | ||
|
|
||
| .PARAMETER InputPath | ||
| Input PPTX file path. | ||
|
|
||
| .PARAMETER OutputDir | ||
| Output directory for SVG files. | ||
|
|
||
| .PARAMETER Slides | ||
| Comma-separated slide numbers to export (optional). | ||
|
|
||
| .PARAMETER SkipVenvSetup | ||
| Skip virtual environment setup. | ||
|
|
||
| .PARAMETER Verbose | ||
| Enable verbose output. | ||
|
|
||
| .EXAMPLE | ||
| ./Invoke-ExportSvg.ps1 -InputPath deck.pptx -OutputDir svg/ | ||
|
|
||
| .NOTES | ||
| Part of the powerpoint skill. Manages uv virtual environment setup | ||
| and delegates to export_svg.py for PPTX-to-SVG conversion. | ||
| #> | ||
|
|
||
| [CmdletBinding()] | ||
| param( | ||
|
auyidi1 marked this conversation as resolved.
|
||
| [Parameter(Mandatory = $true)][string]$InputPath, | ||
| [Parameter(Mandatory = $true)][string]$OutputDir, | ||
| [string]$Slides, | ||
| [switch]$SkipVenvSetup | ||
| ) | ||
|
|
||
| $ErrorActionPreference = 'Stop' | ||
|
auyidi1 marked this conversation as resolved.
|
||
|
|
||
| #region Environment Setup | ||
|
|
||
| $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path | ||
| $SkillRoot = Split-Path -Parent $ScriptDir | ||
| $VenvDir = Join-Path $SkillRoot '.venv' | ||
|
|
||
| #endregion Environment Setup | ||
|
|
||
| #region Main | ||
|
|
||
| if ($MyInvocation.InvocationName -ne '.') { | ||
|
|
||
| if (-not $SkipVenvSetup) { | ||
| if (-not (Get-Command uv -ErrorAction SilentlyContinue)) { | ||
| throw 'uv is required but was not found on PATH.' | ||
| } | ||
| uv sync --directory $SkillRoot | ||
| } | ||
|
|
||
| $python = if (Test-Path (Join-Path $VenvDir 'Scripts/python.exe')) { | ||
| Join-Path $VenvDir 'Scripts/python.exe' | ||
| } elseif (Test-Path (Join-Path $VenvDir 'bin/python')) { | ||
| Join-Path $VenvDir 'bin/python' | ||
| } else { | ||
| throw "Python interpreter not found in venv. Run: uv sync --directory `"$SkillRoot`"" | ||
| } | ||
|
|
||
| $script = Join-Path $ScriptDir 'export_svg.py' | ||
| $ScriptArgs = @($script, '--input', $InputPath, '--output-dir', $OutputDir) | ||
| if ($Slides) { $ScriptArgs += '--slides'; $ScriptArgs += $Slides } | ||
| if ($VerbosePreference -eq 'Continue') { $ScriptArgs += '-v' } | ||
|
|
||
| & $python @ScriptArgs | ||
| exit $LASTEXITCODE | ||
|
|
||
| } | ||
|
|
||
| #endregion Main | ||
83 changes: 83 additions & 0 deletions
83
.github/skills/experimental/powerpoint/scripts/Invoke-GenerateThemes.ps1
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| #!/usr/bin/env pwsh | ||
| # Copyright (c) Microsoft Corporation. | ||
| # SPDX-License-Identifier: MIT | ||
| #Requires -Version 7.0 | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Generate themed content directory variants from a base deck. | ||
|
|
||
| .DESCRIPTION | ||
| Wrapper script that manages the Python virtual environment and invokes | ||
| generate_themes.py to produce themed content copies with remapped colors. | ||
|
|
||
| .PARAMETER ContentDir | ||
| Path to the base theme's content directory. | ||
|
|
||
| .PARAMETER ThemesPath | ||
| Path to a YAML file defining theme color mappings. | ||
|
|
||
| .PARAMETER OutputDir | ||
| Parent directory where themed content directories are created. | ||
|
|
||
| .PARAMETER SkipVenvSetup | ||
| Skip virtual environment setup. | ||
|
|
||
| .PARAMETER Verbose | ||
| Enable verbose output. | ||
|
|
||
| .EXAMPLE | ||
| ./Invoke-GenerateThemes.ps1 -ContentDir content/ -ThemesPath themes.yaml -OutputDir ../ | ||
|
|
||
| .NOTES | ||
| Part of the powerpoint skill. Manages uv virtual environment setup | ||
| and delegates to generate_themes.py for themed content generation. | ||
| #> | ||
|
|
||
| [CmdletBinding()] | ||
| param( | ||
|
auyidi1 marked this conversation as resolved.
|
||
| [Parameter(Mandatory = $true)][string]$ContentDir, | ||
| [Parameter(Mandatory = $true)][string]$ThemesPath, | ||
| [Parameter(Mandatory = $true)][string]$OutputDir, | ||
| [switch]$SkipVenvSetup | ||
| ) | ||
|
|
||
| $ErrorActionPreference = 'Stop' | ||
|
auyidi1 marked this conversation as resolved.
|
||
|
|
||
| #region Environment Setup | ||
|
|
||
| $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path | ||
| $SkillRoot = Split-Path -Parent $ScriptDir | ||
| $VenvDir = Join-Path $SkillRoot '.venv' | ||
|
|
||
| #endregion Environment Setup | ||
|
|
||
| #region Main | ||
|
|
||
| if ($MyInvocation.InvocationName -ne '.') { | ||
|
|
||
| if (-not $SkipVenvSetup) { | ||
| if (-not (Get-Command uv -ErrorAction SilentlyContinue)) { | ||
| throw 'uv is required but was not found on PATH.' | ||
| } | ||
| uv sync --directory $SkillRoot | ||
| } | ||
|
|
||
| $python = if (Test-Path (Join-Path $VenvDir 'Scripts/python.exe')) { | ||
| Join-Path $VenvDir 'Scripts/python.exe' | ||
| } elseif (Test-Path (Join-Path $VenvDir 'bin/python')) { | ||
| Join-Path $VenvDir 'bin/python' | ||
| } else { | ||
| throw "Python interpreter not found in venv. Run: uv sync --directory `"$SkillRoot`"" | ||
| } | ||
|
|
||
| $script = Join-Path $ScriptDir 'generate_themes.py' | ||
| $ScriptArgs = @($script, '--content-dir', $ContentDir, '--themes', $ThemesPath, '--output-dir', $OutputDir) | ||
| if ($VerbosePreference -eq 'Continue') { $ScriptArgs += '-v' } | ||
|
|
||
| & $python @ScriptArgs | ||
| exit $LASTEXITCODE | ||
|
|
||
| } | ||
|
|
||
| #endregion Main | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.