public void Header(string version) { version = version ?? ""; string subtitle = Options.Subtitle ?? ""; string versionText = (version.Split('.').Length >= 3 && version.Split('.')[2] == "0") ? Writer.GetVersion(version, subtitle) : Writer.GetPatchVersion(version, subtitle); SectionLog.Append(String.Format(Writer.HEADER_TPL, version, versionText, DateTime.Now.ToString("yyyy-MM-dd"))); }
public void Section(string title, Section section) { if (section.Messages.Count == 0) { return; } SectionLog.Append(String.Format("\n#### {0}\n\n", title)); foreach (KeyValuePair <string, List <CommitMessage> > entry in section.Messages) { string componentName = entry.Key; List <CommitMessage> messages = entry.Value; string prefix = "*"; bool nested = section.Messages.Count > 1; if (componentName != Writer.EMPTY_COMPONENT) { if (nested) { SectionLog.Append(String.Format("* **{0}:**\n", componentName)); prefix = " *"; } else { prefix = String.Format("* **{0}:**", componentName); } } foreach (var message in messages) { SectionLog.Append(String.Format( "{0} {1} ({2}", prefix, message.Subject, this.Options.CommitLink.Invoke(message.Hash) )); if (message.Closes.Count > 0) { SectionLog.Append(", closes " + String.Join(", ", message.Closes.Select(x => this.Options.IssueLink.Invoke(x)))); } SectionLog.Append(")\n"); } } SectionLog.Append("\n"); }