MCPcopy
hub / github.com/Famous/famous-angular / printSection

Function printSection

changelog.js:81–116  ·  view source on GitHub ↗
(stream, title, section, printCommitLinks)

Source from the content-addressed store, hash-verified

79
80
81var printSection = function(stream, title, section, printCommitLinks) {
82 printCommitLinks = printCommitLinks === undefined ? true : printCommitLinks;
83 var components = Object.getOwnPropertyNames(section).sort();
84
85 if(!components.length || section['$$'].length <= 0) return;
86
87 stream.write(util.format('\n## %s\n\n', title));
88
89 components.forEach(function(name) {
90 var prefix = '-';
91 var nested = section[name].length > 1;
92
93 if(name !== EMPTY_COMPONENT) {
94 if(nested) {
95 stream.write(util.format('- **%s:**\n', name));
96 prefix = ' -';
97 } else {
98 prefix = util.format('- **%s:**', name);
99 }
100 }
101
102 section[name].forEach(function(commit) {
103 if(printCommitLinks) {
104 stream.write(util.format('%s %s\n (%s', prefix, commit.subject, linkToCommit(commit.hash)));
105 if(commit.closes.length) {
106 stream.write(',\n ' + commit.closes.map(linkToIssue).join(', '));
107 }
108 stream.write(')\n');
109 } else {
110 stream.write(util.format('%s %s', prefix, commit.subject));
111 }
112 });
113 });
114
115 stream.write('\n');
116};
117
118
119var readGitLog = function(grep, from) {

Callers 1

writeChangelogFunction · 0.85

Calls 1

linkToCommitFunction · 0.85

Tested by

no test coverage detected