Skip to Content
Md2Docx logo Md2Docx

ICodePluginOptions

Updated 10 Nov 2026

Defined in: code/src/types.ts:78

Configuration options for the code plugin.

Extended by

Properties

blockType?

optional blockType?: "table" | "paragraph"

Defined in: code/src/types.ts:126

Block presentation type when lineNumbers is false:

  • "table": renders a padded single-cell table with background shading and border.
  • "paragraph": renders as a native shaded Paragraph.

Default

"table"

customThemes?

optional customThemes?: Record<string, Partial<ICodeTheme>>

Defined in: code/src/types.ts:88

Additional custom themes catalog mapped by name.

diffHighlight?

optional diffHighlight?: boolean

Defined in: code/src/types.ts:138

Whether to detect and style git diff additions and deletions.

Default

true

fontFamily?

optional fontFamily?: string

Defined in: code/src/types.ts:112

Monospace font family for code blocks and inline code runs.

Default

"Consolas"

fontSize?

optional fontSize?: number

Defined in: code/src/types.ts:118

Font size in half-points (e.g. 19 = 9.5pt, 20 = 10pt, 24 = 12pt).

Default

19

gutterStart?

optional gutterStart?: number

Defined in: code/src/types.ts:100

Starting line number for gutter.

Default

1

gutterWidthPercent?

optional gutterWidthPercent?: number

Defined in: code/src/types.ts:106

Width percentage allocated to gutter column when lineNumbers is true. Auto-calculated based on line count if not specified.

highlightInline?

optional highlightInline?: boolean

Defined in: code/src/types.ts:132

Whether to intercept and highlight inlineCode MDAST nodes.

Default

true

lineNumbers?

optional lineNumbers?: boolean

Defined in: code/src/types.ts:94

Whether to display line numbers in a gutter column.

Default

false

tabSize?

optional tabSize?: number

Defined in: code/src/types.ts:144

Number of spaces to replace tab (\t) characters with.

Default

2

theme?

optional theme?: PresetThemeName | string & object | ICodeTheme

Defined in: code/src/types.ts:83

Active theme name or custom theme object.

Default

"github-light"

tokenizer?

optional tokenizer?: (code, language?) => Token[][]

Defined in: code/src/types.ts:149

Optional custom tokenizer override.

Parameters

code

string

language?

string

Returns

Token[][]

On this page