Skip to content

Instantly share code, notes, and snippets.

@TheoChevalier
Created December 18, 2015 14:48
Show Gist options
  • Save TheoChevalier/cf32ff96507946439e2b to your computer and use it in GitHub Desktop.
Save TheoChevalier/cf32ff96507946439e2b to your computer and use it in GitHub Desktop.
<?php
namespace Transvision;
$output = '';
foreach ($changelog as $release => $changes) {
// Add release title and initialize variables
$output .= $release_title($release);
$empty_release = true;
$section = '';
foreach ($changes as $change => $attributes) {
if ($section != $attributes['section'][0]) {
$section = $attributes['section'][0];
if (! $empty_release) {
$output .= "</ul>\n";
}
$output .= '<h3>' . $get_sections($section) . "</h3>\n<ul>\n";
$empty_release = false;
}
$output .= " <li>";
$output .= isset($attributes['type']) ? $relnotes($attributes['type'][0]) . ' ' : '';
$output .= isset($attributes['issues']) ? $issue($attributes['issues']) : '';
$output .= isset($attributes['commit']) ? $commit($attributes['commit']) : '';
$output .= $attributes['message'][0];
$output .= isset($attributes['authors']) ? $authors($attributes['authors']) : '';
$output .= "</li>\n";
}
$output .= "</ul>\n";
$output .= $github_link($release);
$section = '';
}
printf($output);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment