1- <#@ template debug="true" hostspecific="true" language="C#" #>
2- <#@ import namespace="System" #>
3- <#@ import namespace="System.Linq" #>
4- <#@ import namespace="System.Collections.Generic" #>
5- <#
6- //System.Diagnostics.Debugger.Launch();
7- //System.Diagnostics.Debugger.Break();
8-
9- TemplateModel model = Host.GetTemplateModel();
10- ReleaseNoteConfig config = Host.GetConfig();
11- #>
12- <#
13- if (model.IsRenderTitle)
14- {
15- WriteLine($"## {model.ProjectData}");
16- }
17- #>
18-
19- <#
20- foreach (Section section in model.Sections)
21- {
22- if (!string.IsNullOrEmpty(section.DisplayName))
23- {
24- WriteLine($"\n### {section.DisplayName}\n");
25- }
26-
27- if (section.Categories.Count == 0)
28- {
29- WriteLine("No significant changes.\n");
30- continue;
31- }
32-
33- foreach (Category category in section.Categories)
34- {
35- WriteLine($"#### {category.DisplayName}\n");
36-
37- if (category.Contents.Count == 0)
38- {
39- WriteLine("No significant changes.\n");
40- continue;
41- }
42-
43- foreach (Content content in category.Contents)
44- {
45- (string text, List<string> issues) = content;
46- Write($"- {text}");
47- if (issues.Count == 0)
48- {
49- WriteLine("");
50- continue;
51- }
52-
53- if (text.Contains("\n - ") || text.Contains("\n * "))
54- {
55- Write("\n\n (");
56- }
57- else
58- {
59- if (!string.IsNullOrEmpty(text))
60- {
61- Write(" (");
62- }
63- }
64-
65- for (int i = 0; i < issues.Count; i++)
66- {
67- string issue = issues[i];
68- Write(issue.Split(": ", 2)[0]);
69- if (i < issues.Count - 1)
70- {
71- Write(", ");
72- }
73- }
74-
75- if (!string.IsNullOrEmpty(text))
76- {
77- Write(")");
78- }
79- WriteLine("");
80- }
81-
82-
83- List<string> categoryIssues = category.GetAllIssues();
84- if (categoryIssues.Count > 0 && categoryIssues.First().Contains("]: "))
85- {
86- WriteLine("");
87- foreach (string issue in categoryIssues)
88- {
89- WriteLine(issue);
90- }
91- }
92- WriteLine("");
93-
94- }
95- }
1+ <#@ template debug="true" hostspecific="true" language="C#" #>
2+ <#@ import namespace="System" #>
3+ <#@ import namespace="System.Linq" #>
4+ <#@ import namespace="System.Collections.Generic" #>
5+ <#
6+ //System.Diagnostics.Debugger.Launch();
7+ //System.Diagnostics.Debugger.Break();
8+
9+ TemplateModel model = Host.GetTemplateModel();
10+ ReleaseNoteConfig config = Host.GetConfig();
11+ #>
12+ <#
13+ if (model.IsRenderTitle)
14+ {
15+ WriteLine($"## {model.ProjectData}");
16+ }
17+ #>
18+
19+ <#
20+ foreach (Section section in model.Sections)
21+ {
22+ if (!string.IsNullOrEmpty(section.DisplayName))
23+ {
24+ WriteLine($"\n### {section.DisplayName}\n");
25+ }
26+
27+ if (section.Categories.Count == 0)
28+ {
29+ WriteLine("No significant changes.\n");
30+ continue;
31+ }
32+
33+ foreach (Category category in section.Categories)
34+ {
35+ WriteLine($"#### {category.DisplayName}\n");
36+
37+ if (category.Contents.Count == 0)
38+ {
39+ WriteLine("No significant changes.\n");
40+ continue;
41+ }
42+
43+ foreach (Content content in category.Contents)
44+ {
45+ (string text, List<string> issues) = content;
46+ Write($"- {text}");
47+ if (issues.Count == 0)
48+ {
49+ WriteLine("");
50+ continue;
51+ }
52+
53+ if (text.Contains("\n - ") || text.Contains("\n * "))
54+ {
55+ Write("\n\n (");
56+ }
57+ else
58+ {
59+ if (!string.IsNullOrEmpty(text))
60+ {
61+ Write(" (");
62+ }
63+ }
64+
65+ for (int i = 0; i < issues.Count; i++)
66+ {
67+ string issue = issues[i];
68+ Write(issue.Split(": ", 2)[0]);
69+ if (i < issues.Count - 1)
70+ {
71+ Write(", ");
72+ }
73+ }
74+
75+ if (!string.IsNullOrEmpty(text))
76+ {
77+ Write(")");
78+ }
79+ WriteLine("");
80+ }
81+
82+
83+ List<string> categoryIssues = category.GetAllIssues();
84+ if (categoryIssues.Count > 0 && categoryIssues.First().Contains("]: "))
85+ {
86+ WriteLine("");
87+ foreach (string issue in categoryIssues)
88+ {
89+ WriteLine(issue);
90+ }
91+ }
92+ WriteLine("");
93+
94+ }
95+ }
9696#>
0 commit comments