> ## Documentation Index
> Fetch the complete documentation index at: https://mint-tsdocs.saulo.engineer/llms.txt
> Use this file to discover all available pages before exploring further.

# MarkdownEmitter class

> Base class for rendering TSDoc nodes to Markdown/MDX format This emitter traverses a TSDoc abstract syntax tree and converts it to markdown text. It handles standard markdown constructs (bold, italic, code, links) and provides extension points for subclasses to customize behavior. \#\# Key Features - \\TSDoc Node Processing\\: Converts all standard TSDoc nodes to markdown - \\Text Escaping\\: Ensures special markdown characters are properly escaped - \\Formatting Tracking\\: Maintains state for bold/italic formatting - \\Extension Points\\: Virtual methods for subclass customization \#\# Extension Points Subclasses can override these virtual methods: - writeNode() - Customize handling for specific node types - writeLinkTagWithCodeDestination() - Handle links to code symbols (e.g., ) - writeLinkTagWithUrlDestination() - Handle external URL links \#\# Usage Example ``typescript const emitter = new MarkdownEmitter(); const markdown = emitter.emit(stringBuilder, docNode, options); ``

export const RefLink = ({target, children}) => {
  if (!target || typeof target !== 'string') {
    console.error('RefLink: Invalid target prop. Expected non-empty string.');
    return <span className="tsdocs-reflink broken-link" title="Invalid RefLink target" data-component="tsdocs-reflink">Invalid Link</span>;
  }
  const linkText = children || target;
  const path = typeof window !== 'undefined' && window.getRefPath ? window.getRefPath(target) : `./${target.split('.').filter(s => s.length > 0).join('/')}`;
  const isValid = typeof window !== 'undefined' && window.VALID_REFS && window.VALID_REFS.has(target);
  const className = !isValid ? 'tsdocs-reflink broken-link' : 'tsdocs-reflink';
  const title = !isValid ? `Broken API reference: ${target}` : undefined;
  return <a href={path} className={className} title={title} data-component="tsdocs-reflink">
      {linkText}
    </a>;
};

export const PageLink = ({target, children}) => {
  if (!target || typeof target !== 'string') {
    console.error('PageLink: Invalid target prop. Expected non-empty string.');
    return <span className="tsdocs-pagelink broken-link" title="Invalid PageLink target" data-component="tsdocs-pagelink">Invalid Link</span>;
  }
  const linkText = children || target;
  let path = target;
  if (!path.startsWith('/')) {
    path = `/${target}`;
  }
  const isValid = typeof window !== 'undefined' && window.VALID_PAGES && window.VALID_PAGES.has(target);
  const className = !isValid ? 'tsdocs-pagelink broken-link' : 'tsdocs-pagelink';
  const title = !isValid ? `Broken page link: ${target}` : undefined;
  return <a href={path} className={className} title={title} data-component="tsdocs-pagelink">
      {linkText}
    </a>;
};

# MarkdownEmitter

## Summary

Base class for rendering TSDoc nodes to Markdown/MDX format  This emitter traverses a TSDoc abstract syntax tree and converts it to markdown text. It handles standard markdown constructs (bold, italic, code, links) and provides extension points for subclasses to customize behavior.  ## Key Features  - **TSDoc Node Processing**: Converts all standard TSDoc nodes to markdown - **Text Escaping**: Ensures special markdown characters are properly escaped - **Formatting Tracking**: Maintains state for bold/italic formatting - **Extension Points**: Virtual methods for subclass customization  ## Extension Points  Subclasses can override these virtual methods: - `writeNode()` - Customize handling for specific node types - `writeLinkTagWithCodeDestination()` - Handle links to code symbols (e.g., \[object Object]) - `writeLinkTagWithUrlDestination()` - Handle external URL links  ## Usage Example

## Signature

```typescript theme={null}
export declare class MarkdownEmitter 
```

## Constructors

*No constructors defined.*

## Properties

*No properties defined.*

## Methods

### emit

Converts a TSDoc node tree to markdown text

### getEscapedText

**Modifiers**: protected

Escapes text for safe markdown output

### getTableEscapedText

**Modifiers**: protected

Escapes text for safe output in markdown table cells

### writeLinkTagWithCodeDestination

**Modifiers**: protected

Writes a link tag that references a code symbol

### writeLinkTagWithUrlDestination

**Modifiers**: protected

Writes a link tag that references an external URL

### writeNode

**Modifiers**: protected

Writes a single TSDoc node to the output

### writeNodes

**Modifiers**: protected

Writes multiple TSDoc nodes sequentially

### writePlainText

**Modifiers**: protected

Writes plain text with context-aware formatting

## Events

*No events defined.*

## Remarks

This class is designed to be extended. The base implementation provides standard markdown output, but subclasses like CustomMarkdownEmitter add support for Mintlify components and other custom behaviors.
