Repository: JetBrains/compose-multiplatform
File: tools/changelog.main.kts (Kotlin)

Code before:
                    subsection,
                    link.takeIf { isTopLevel }
                )
            )
        }
    }

    return list
}

/**
 * @param repo Example:
 *        JetBrains/compose-multiplatform-core
 */
fun entriesForRepo(repo: String): List<ChangelogEntry> {
    val pullNumberToPull = (1..5)
        .flatMap {
            request<Array<GitHubPullEntry>>("https://api.github.com/repos/$repo/pulls?state=closed&per_page=100&page=$it").toList()
        }
        .associateBy { it.number }

    fun prForCommit(commit: GitHubCompareResponse.CommitEntry): GitHubPullEntry? {
        val repoNumber = repoNumberForCommit(commit)
        return pullNumberToPull[repoNumber]
    }

    fun changelogEntriesFor(
        commit: GitHubCompareResponse.CommitEntry,
        pullRequest: GitHubPullEntry?
    ): List<ChangelogEntry> {
        return if (pullRequest != null) {
            val prTitle = pullRequest.title
            val prNumber = pullRequest.number
            val prLink = "https://github.com/$repo/pull/$prNumber"
            val prList = pullRequest.extractReleaseNotes(prLink)
            prList.ifEmpty {
                listOf(ChangelogEntry(prTitle, null, null, prLink))
            }
        } else {
            listOf()
        }
    }

    val commits = fetchPagedUntilEmpty { page ->
        request<GitHubCompareResponse>("https://api.github.com/repos/$repo/compare/$firstCommit...$lastCommit?per_page=1000&page=$page")
            .commits
    }.toSet()

    fun GitHubCompareResponse.CommitEntry.commitId() = repoNumberForCommit(this)?.toString() ?: sha

    return commits.flatMap { changelogEntriesFor(it, prForCommit(it)) }

Review comment (suggestion):
I guess we can parse configs and automatically add

```suggestion
        appendLine("## Dependencies\n")
        appendLine("- Gradle Plugin `org.jetbrains.compose`, version `${version}`. Based on Jetpack Compose libraries:")
        // TBD
        appendLine("___")
    }
```

Code after:
                  - [Material3 REDIRECT_PLACEHOLDER](https://developer.android.com/jetpack/androidx/releases/compose-material3#REDIRECT_PLACEHOLDER)
        
                - Lifecycle libraries `org.jetbrains.androidx.lifecycle:lifecycle-*:RELEASE_PLACEHOLDER`. Based on [Jetpack Lifecycle REDIRECT_PLACEHOLDER](https://developer.android.com/jetpack/androidx/releases/lifecycle#REDIRECT_PLACEHOLDER)
                - Navigation libraries `org.jetbrains.androidx.navigation:navigation-*:RELEASE_PLACEHOLDER`. Based on [Jetpack Navigation REDIRECT_PLACEHOLDER](https://developer.android.com/jetpack/androidx/releases/navigation#REDIRECT_PLACEHOLDER)
                - Material3 Adaptive libraries `org.jetbrains.compose.material3.adaptive:adaptive*:RELEASE_PLACEHOLDER`. Based on [Jetpack Material3 Adaptive REDIRECT_PLACEHOLDER](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive#REDIRECT_PLACEHOLDER)
        
                ___
            """.trimIndent()
        )

        appendLine()
        appendLine()

        val nonstandardSections = entries.mapNotNull { it.section }.toSet() - standardSections
        val nonstandardSubsections = entries.mapNotNull { it.subsection }.toSet() - standardSubsections

        if (nonstandardSections.isNotEmpty()) {
            println()
            println("WARNING! Changelog contains nonstandard sections. Please change them to the standard ones, or enhance the list in the PR template. List:\n${nonstandardSections.joinToString("\n")}")
        }

        if (nonstandardSubsections.isNotEmpty()) {
            println()
            println("WARNING! Changelog contains nonstandard subsections. Please change them to the standard ones, or enhance the list in the PR template. List:\n${nonstandardSubsections.joinToString("\n")}")
        }
    }
}

/**
 * Transforms v1.6.0-beta01 to 1.6.0-beta01
 */
fun commitToVersion(commit: String) =
    if (commit.startsWith("v") && commit.contains(".")) {
        commit.removePrefix("v")
    } else {
        commit.removePrefix("release/")
    }

/**
 * September 2024
 */
fun currentChangelogDate() = LocalDate.now().format(DateTimeFormatter.ofPattern("MMMM yyyy", Locale.ENGLISH))

/**
 * Formats:
 * - A new approach to implementation of `platformLayers`. Now extra layers (such as Dialogs and Popups) drawing is merged into a single screen size canvas.
 *
 * to:
 * - [A new approach to implementation of `platformLayers`](link). Now extra layers (such as Dialogs and Popups) drawing is merged into a single screen size canvas.
 */
fun ChangelogEntry.format(): String {