python2igcse
Version:
Convert Python code to IGCSE Pseudocode format
87 lines • 2.22 kB
TypeScript
import { IR } from '../types/ir';
import { EmitResult, EmitterOptions, MarkdownConfig } from '../types/emitter';
import { TextEmitter } from './text-emitter';
/**
* Emitter that outputs IGCSE Pseudocode in Markdown format
*/
export declare class MarkdownEmitter extends TextEmitter {
private markdownConfig;
constructor(options?: Partial<EmitterOptions>, markdownConfig?: Partial<MarkdownConfig>);
/**
* Convert IR to Markdown format
*/
emit(ir: IR): EmitResult;
/**
* Output Markdown header
*/
private emitMarkdownHeader;
/**
* Generate table of contents
*/
private emitTableOfContents;
/**
* Generate table of contents entries
*/
private generateTocEntries;
/**
* Output description
*/
private emitDescription;
/**
* Start code block
*/
private emitCodeBlockStart;
/**
* End code block
*/
private emitCodeBlockEnd;
/**
* Output Markdown footer
*/
private emitMarkdownFooter;
/**
* Function/procedure header with anchor link
*/
protected emitProcedure(node: IR): void;
/**
* Output function (same as procedure)
*/
protected emitFunction(node: IR): void;
/**
* Format for inline code
*/
protected formatInlineCode(text: string): string;
/**
* Add emphasized text
*/
protected emitEmphasis(text: string, type?: 'bold' | 'italic'): void;
/**
* Output list item
*/
protected emitListItem(text: string, level?: number): void;
/**
* Output horizontal rule
*/
protected emitHorizontalRule(): void;
/**
* Output link
*/
protected emitLink(text: string, url: string): void;
/**
* Output image
*/
protected emitImage(altText: string, url: string, title?: string): void;
/**
* Output table
*/
protected emitTable(headers: string[], rows: string[][]): void;
/**
* Output blockquote
*/
protected emitBlockquote(text: string): void;
/**
* Update Markdown configuration
*/
updateMarkdownConfig(config: Partial<MarkdownConfig>): void;
}
//# sourceMappingURL=markdown-emitter.d.ts.map