Home / File/ highlight-code.ts — ui Source File

highlight-code.ts — ui Source File

Architecture documentation for highlight-code.ts, a typescript file in the ui codebase. 1 imports, 0 dependents.

File typescript ComponentRegistry Styles 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  32f3789c_d450_95f1_cdcf_aeab6933fd4b["highlight-code.ts"]
  8af2f07a_2b3a_c980_6d52_d7f80a9ee5a4["shiki"]
  32f3789c_d450_95f1_cdcf_aeab6933fd4b --> 8af2f07a_2b3a_c980_6d52_d7f80a9ee5a4
  style 32f3789c_d450_95f1_cdcf_aeab6933fd4b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { codeToHtml } from "shiki"

export async function highlightCode(code: string) {
  const html = await codeToHtml(code, {
    lang: "jsx",
    theme: "github-dark-default",
    transformers: [
      {
        code(node) {
          node.properties["data-line-numbers"] = ""
        },
      },
    ],
  })

  return html
}

Subdomains

Functions

Dependencies

  • shiki

Frequently Asked Questions

What does highlight-code.ts do?
highlight-code.ts is a source file in the ui codebase, written in typescript. It belongs to the ComponentRegistry domain, Styles subdomain.
What functions are defined in highlight-code.ts?
highlight-code.ts defines 1 function(s): highlightCode.
What does highlight-code.ts depend on?
highlight-code.ts imports 1 module(s): shiki.
Where is highlight-code.ts in the architecture?
highlight-code.ts is located at deprecated/www/lib/highlight-code.ts (domain: ComponentRegistry, subdomain: Styles, directory: deprecated/www/lib).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free