Skip to content

Changelog ​

Generate a release-note section with a title and a 4-column version table.

Import ​

ts
import { changelogPlugin, type ChangelogOptions } from 'docx-kit'

Options ​

OptionTypeDefaultDescription
entriesChangelogEntry[]requiredList of version rows
titlestring'Changelog'Heading text shown above the table

ChangelogEntry fields:

FieldTypeDescription
versionstringVersion label
datestringRelease date
type'added' | 'changed' | 'fixed' | 'removed'Entry category with its own highlight color
changesstringHuman-readable change summary

Example ​

ts
import { changelogPlugin, createDocx } from 'docx-kit'

const doc = createDocx()
  .use(changelogPlugin())
  .plugin('changelog', {
    title: 'Release Notes',
    entries: [
      { version: '1.4.0', date: '2026-06-14', type: 'added', changes: 'Added zh-TW docs locale.' },
      { version: '1.4.1', date: '2026-06-15', type: 'fixed', changes: 'Corrected plugin sidebar links.' },
    ],
  })

Notes ​

  • Empty entries still render the title with a centered (no entries) placeholder.
  • The plugin is a good fit for release notes, migration logs, or compliance change histories.

Style customization ​

Pass { styles } to the factory for instance defaults, and options.styles for invocation overrides. The package and docx-kit entry points export ChangelogConfig and ChangelogStyles. Priority: built-in/theme defaults → initialization styles → common node style → invocation part styles. Nested fields merge; arrays replace; undefined retains defaults; 0 and false apply. Units and theme tokens such as $colors.primary are supported.

PartsStyle typeScope
bodyText, emptyText, headerText, titleTextStyleRuleRun typography
bodyParagraph, emptyParagraph, headerParagraph, titleParagraphParagraphStyleRuleBackground, borders, alignment, spacing and flow
bodyCell, headerCellOmit<CellStyleRule, 'height'>Cell shading, borders, width and padding
ts
changelogPlugin({
  styles: { headerText: { color: '#2563EB', fontSize: 14 } },
})

Use the same part names in options.styles for a single call. JSON DSL, AI tool schemas and MCP validation share these contracts; unknown parts and misplaced properties are rejected.

Released under the MIT License.