Loading clean_notebook_outputs.ps1 0 → 100644 +16 −0 Original line number Diff line number Diff line # Define the root directory of your repository $repoPath = $PSScriptRoot # Find all .ipynb files within the repository and its subdirectories $notebookFiles = Get-ChildItem -Path $repoPath -Filter "*.ipynb" -Recurse Write-Host "The script is located in: $repoPath" foreach ($notebookFile in $notebookFiles) { Write-Host "Cleaning $($notebookFile.FullName)..." # Execute nb-clean on the current notebook. # The '-m' flag preserves cell metadata, adjust as needed. # For other options like -e (remove empty cells) or -o (preserve outputs), refer to nb-clean documentation. nb-clean clean "$($notebookFile.FullName)" Write-Host "Cleaned $($notebookFile.FullName)." } Loading
clean_notebook_outputs.ps1 0 → 100644 +16 −0 Original line number Diff line number Diff line # Define the root directory of your repository $repoPath = $PSScriptRoot # Find all .ipynb files within the repository and its subdirectories $notebookFiles = Get-ChildItem -Path $repoPath -Filter "*.ipynb" -Recurse Write-Host "The script is located in: $repoPath" foreach ($notebookFile in $notebookFiles) { Write-Host "Cleaning $($notebookFile.FullName)..." # Execute nb-clean on the current notebook. # The '-m' flag preserves cell metadata, adjust as needed. # For other options like -e (remove empty cells) or -o (preserve outputs), refer to nb-clean documentation. nb-clean clean "$($notebookFile.FullName)" Write-Host "Cleaned $($notebookFile.FullName)." }