Skip to content

Release Notes Customization

Release notes generation uses the mustache templating engine.

The easiest way to customize the release notes is to use custom templates.

Quick Start Snippet

require "apadmi_grout"

document_template = "<Document template, see below>"
list_template = "<List template, see below>"

release_notes = generate_release_notes(
  ...                
  templates: Apadmi::Grout::Templates.new(document_template, list_template)                
)

Simply pass in custom templates (the easiest way is to copy those below and tweak them) and they will be used instead.

Template Files

The document_template is the main document template which includes the list_template multiple times internally.

Release notes template visualisation

Default Templates

Here are the default templates for reference:

# frozen_string_literal: true

module Apadmi
  module Grout
    # Default baked in templates for generating release notes
    class DefaultTemplates
      def default_document_template
        %{# {{config.title}}

### Version
{{config.app_version}}

### Release date
{{config.date}}

### Minimum Supported OS
{{config.min_os_version}}

### Build Details
Commit Hash: {{config.commit_hash}}
[CI/CD build \#{{config.ci_build_number}}]({{config.ci_build_url}})

## Tickets Moved By This Build
{{ rendered_moved_issues }}
## Sprint Release notes
{{ rendered_release_issues }} }
      end

      def default_list_template
        %{### New functionality
{{# classified_issues.features.first}}
{{# classified_issues.features}}
* [{{ key }} - {{ summary }}]({{ url }})
{{/ classified_issues.features}}

{{/ classified_issues.features.first}}
{{# classified_issues.improvements.first}}
### Improvements
  {{# classified_issues.improvements}}
* [{{ key }} - {{ summary }}]({{ url }})
  {{/ classified_issues.improvements}}

{{/ classified_issues.improvements.first}}
{{# classified_issues.tasks.first}}
### Completed Tasks
  {{# classified_issues.tasks}}
* [{{ key }} - {{ summary }}]({{ url }})
  {{/ classified_issues.tasks}}

{{/ classified_issues.tasks.first}}
{{# classified_issues.defects.first}}
### Fixed defects
  {{# classified_issues.defects}}
* [{{ key }} - {{ summary }}]({{ url }})
  {{/ classified_issues.defects}}

{{/ classified_issues.defects.first}}
{{# classified_issues.others.first}}
### Other issue types
  {{# classified_issues.others}}
* [{{issue_type}} - {{ key }} - {{ summary }}]({{ url }})
  {{/ classified_issues.others}}

{{/ classified_issues.others.first}}}
      end
    end

    # @param document_template [String] the template for the entire document
    # @param list_template [String] the template for the repeated subsection listing issues
    Templates = Struct.new(
      :document_template,
      :list_template
    ) do
      # @return returns the default hardcoded templates
      def self.default
        defaults = DefaultTemplates.new
        Templates.new(defaults.default_document_template, defaults.default_list_template)
      end
    end
  end
end

Yard Reference

Back to top