MCPcopy
hub / github.com/deepnote/deepnote / highlightContent

Function highlightContent

packages/cli/src/commands/cat.ts:282–295  ·  view source on GitHub ↗

* Apply syntax highlighting to content based on block type using Shiki. * Only applies highlighting when color output is enabled.

(content: string, type: DeepnoteBlock['type'])

Source from the content-addressed store, hash-verified

280 * Only applies highlighting when color output is enabled.
281 */
282async function highlightContent(content: string, type: DeepnoteBlock['type']): Promise<string> {
283 const { color } = getOutputConfig()
284
285 if (color) {
286 if (type === 'code') {
287 return codeToANSI(content, 'python', 'catppuccin-macchiato')
288 }
289 if (type === 'sql') {
290 return codeToANSI(content, 'sql', 'catppuccin-macchiato')
291 }
292 }
293
294 return content
295}

Callers 1

printBlockFunction · 0.85

Calls 1

getOutputConfigFunction · 0.90

Tested by

no test coverage detected