From 515511094d75d2bd022fdccf5ff89d6ba861e122 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 27 Mar 2020 17:40:12 -0700 Subject: [PATCH] Update change log generation script to support collapsible sections (#12214) --- tools/releaseTools.psm1 | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/releaseTools.psm1 b/tools/releaseTools.psm1 index b87394fa56..9d0f487676 100644 --- a/tools/releaseTools.psm1 +++ b/tools/releaseTools.psm1 @@ -341,21 +341,31 @@ function Get-ChangeLog PrintChangeLog -clSection $clBreakingChange -sectionTitle 'Breaking Changes' PrintChangeLog -clSection $clEngine -sectionTitle 'Engine Updates and Fixes' PrintChangeLog -clSection $clExperimental -sectionTitle 'Experimental Features' - PrintChangeLog -clSection $clGeneral -sectionTitle 'General Cmdlet Updates and Fixes' - PrintChangeLog -clSection $clCodeCleanup -sectionTitle 'Code Cleanup' PrintChangeLog -clSection $clPerformance -sectionTitle 'Performance' + PrintChangeLog -clSection $clGeneral -sectionTitle 'General Cmdlet Updates and Fixes' + PrintChangeLog -clSection $clCodeCleanup -sectionTitle 'Code Cleanup' -Compress PrintChangeLog -clSection $clTools -sectionTitle 'Tools' PrintChangeLog -clSection $clTest -sectionTitle 'Tests' - PrintChangeLog -clSection $clBuildPackage -sectionTitle 'Build and Packaging Improvements' + PrintChangeLog -clSection $clBuildPackage -sectionTitle 'Build and Packaging Improvements' -Compress PrintChangeLog -clSection $clDocs -sectionTitle 'Documentation and Help Content' Write-Output "[${version}]: https://github.com/PowerShell/PowerShell/compare/${$LastReleaseTag}...${ThisReleaseTag}`n" } -function PrintChangeLog($clSection, $sectionTitle) { +function PrintChangeLog($clSection, $sectionTitle, [switch] $Compress) { if ($clSection.Count -gt 0) { "### $sectionTitle`n" - $clSection | ForEach-Object -MemberName ChangeLogMessage + + if ($Compress) { + $items = $clSection.ChangeLogMessage -join "`n" + + "
`n" + $items | ConvertFrom-Markdown | Select-Object -ExpandProperty Html + "
" + } + else { + $clSection | ForEach-Object -MemberName ChangeLogMessage + } "" } }