MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / header

Function header

apps/desktop/src/cli/help.ts:192–204  ·  view source on GitHub ↗
(width: number)

Source from the content-addressed store, hash-verified

190]
191
192function header(width: number): string[] {
193 // Box-drawing header. The inner content is padded so the right edge
194 // lines up regardless of color codes.
195 const inner = width - 4
196 const tagline = 'ZenNotes CLI · capture, search, edit your vault from any terminal'
197 const titleLine = `${bold(cyan('zn'))} ${dim(`v${HELP_VERSION}`)}`
198 const taglineWrapped = wrapLines(tagline, inner).map((l) => dim(l))
199 const lines = [titleLine, ...taglineWrapped]
200 const top = '╭' + '─'.repeat(width - 2) + '╮'
201 const bottom = '╰' + '─'.repeat(width - 2) + '╯'
202 const middle = lines.map((l) => '│ ' + pad(l, inner) + ' │')
203 return [top, ...middle, bottom]
204}
205
206function section(heading: string, rows: CommandRow[], width: number): string[] {
207 const out: string[] = []

Callers 1

renderHelpFunction · 0.85

Calls 5

boldFunction · 0.85
cyanFunction · 0.85
dimFunction · 0.85
wrapLinesFunction · 0.85
padFunction · 0.70

Tested by

no test coverage detected