LumisDocs
Recipes

Wrap output with custom HTML

Wrap highlighted output with custom header and container HTML.

const html = await highlight(
  'const x = 1',
  htmlInline({
    language: javascript,
    theme: frappe,
    header: {
      openTag: '<figure><figcaption>index.js</figcaption>',
      closeTag: '</figure>',
    },
  })
)

See Build a code block header with copy button for a fuller pattern.