MarkdownRenderer

Class
Read only: Yes Final: Yes

Renders Keep a Changelog markdown in a deterministic package-friendly format.

Table of Contents

Interfaces

MarkdownRendererInterface

Renders managed changelog domain objects into markdown.

Constants

 = "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)."

Methods

render()

Renders the full changelog markdown content.

 : string
renderReleaseBody()

Renders only the body content of one released version.

 : string
normalizeRepositoryUrl()

Normalizes repository URLs to the public HTTPS form expected by footer links.

 : string|null
 : array<int, string>
 : array<int, string>
resolveTag()

Resolves the git tag name for a rendered release.

 : string
Constants

Constants

INTRODUCTION

Private
private mixed INTRODUCTION = "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)."
Methods

render()

Public

Renders the full changelog markdown content.

public render(ChangelogDocument  $document[, string|null  $repositoryUrl = null]) : string
Parameters
$document : ChangelogDocument
$repositoryUrl : string|null = null
Return values
string

normalizeRepositoryUrl()

Private

Normalizes repository URLs to the public HTTPS form expected by footer links.

private normalizeRepositoryUrl( string|null  $repositoryUrl) : string|null
Parameters
$repositoryUrl : string|null
Return values
string|null

renderReferences()

Private
private renderReferences(ChangelogDocument  $document, string|null  $repositoryUrl) : array<int, string>
Parameters
$document : ChangelogDocument
$repositoryUrl : string|null
Return values
array<int, string>