MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / formatMarkdown

Function formatMarkdown

utils/scripts/generate-release-notes.js:164–190  ·  view source on GitHub ↗
(tag, prevTag, sections, { plain })

Source from the content-addressed store, hash-verified

162};
163
164function formatMarkdown(tag, prevTag, sections, { plain }) {
165 const lines = [
166 flags.changelogOnly
167 ? ""
168 : `Changes since [${prevTag}](https://github.com/${owner}/${repo}/releases/tag/${prevTag})`,
169 "",
170 ];
171
172 for (const [type, list] of Object.entries(sections)) {
173 if (list.length === 0) continue;
174 const header = plain
175 ? `## ${type}`
176 : `## ${emojis[type]}${type[0].toUpperCase() + type.slice(1)}`;
177 lines.push(header, "", list.join("\n"), "");
178 }
179
180 // Compact single-line mode for super small output
181 // if (plain) {
182 // const compact = Object.entries(sections)
183 // .filter(([_, list]) => list.length)
184 // .map(([type, list]) => `${type.toUpperCase()}: ${list.length} commits`)
185 // .join(" | ");
186 // lines.push(`\n_Summary: ${compact}_`);
187 // }
188
189 return lines.join("\n");
190}
191
192function formatJSON(tag, prevTag, sections, plain = true) {
193 const lines = [

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected