Skip to content

⬅️ Back to Table of Contents

📄 CodeBlock/utils

📊 Analysis Summary

Metric Count
🔧 Functions 1
📦 Imports 1

📚 Table of Contents

🛠️ File Location:

📂 packages/website/src/theme/CodeBlock/utils.ts

📦 Imports

Name Source
CodeBlockMetadata @docusaurus/theme-common/internal

Functions

getVisibleCodeLines(metadata: CodeBlockMetadata): string[]

Parameters:

  • metadata CodeBlockMetadata

Returns: string[]

Calls:

  • metadata.code .split('\n') .filter
  • (metadata.lineClassNames[i] as string[] | undefined)?.includes
Code
export function getVisibleCodeLines(metadata: CodeBlockMetadata): string[] {
  return metadata.code
    .split('\n')
    .filter(
      (_, i) =>
        !(metadata.lineClassNames[i] as string[] | undefined)?.includes(
          'code-block-removed-line',
        ),
    );
}

Generated by Syntax Scribe