Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Unreleased
## v2.15.0 - 2026-11-01

### Added

Expand All @@ -9,7 +9,7 @@

### Compatibility

- These are new methods on the `domain.Paragraph` and `domain.TableRow` interfaces. Code that only uses docxgo's own types needs no change; an external type implementing either interface must add them.
- **`domain.Paragraph` and `domain.TableRow` gained methods** (`Shading`, `SetShading`, `ClearShading`, `KeepNext`, `SetKeepNext`, `KeepLines`, `SetKeepLines` on `Paragraph`; `RepeatAsHeader`, `SetRepeatAsHeader`, `CantSplit`, `SetCantSplit` on `TableRow`). Code that only uses docxgo's own types needs no change. If you implement either interface with your own type, most commonly a hand-written test double, you must add the new methods; embedding `domain.Paragraph` or `domain.TableRow` in your type is unaffected, since the methods are promoted automatically. The only exported function that accepts a caller-provided value of either type is `template.ConsolidateRuns(domain.Paragraph)`. This is a minor release for the same reason as `domain.Run.SetLanguage` in v2.12.0 and the `domain.Header`/`domain.Footer` methods in v2.13.0: the interfaces describe types docxgo itself returns, not an extension point.

---

Expand Down
4 changes: 2 additions & 2 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Migration Guide: v1 → docxgo v2

**Current target:** v2.14.0
**Current target:** v2.15.0
**Minimum Go version:** 1.23

This guide covers migration from the historical `fumiama/go-docx` API to the
Expand All @@ -27,7 +27,7 @@ For the complete current API, see the [API guide](docs/V2_API_GUIDE.md) and
## 1. Update the module

```bash
go get github.com/mmonterroca/docxgo/v2@v2.14.0
go get github.com/mmonterroca/docxgo/v2@v2.15.0
go mod tidy
```

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Since v2.7.0 it also ships a JSON-RPC command-line interface and a Node.js wrapp
- **Proofing language** — `WithLanguage` / `WithLanguageEx` for spell-check, grammar, hyphenation
- **Production quality** — clean architecture, explicit errors, thread-safe internals

**Status:** v2.14.0 · Production-ready · Requires Go 1.23+ (no external C dependencies; runs on Linux, macOS, Windows). See the [CHANGELOG](CHANGELOG.md) for version history.
**Status:** v2.15.0 · Production-ready · Requires Go 1.23+ (no external C dependencies; runs on Linux, macOS, Windows). See the [CHANGELOG](CHANGELOG.md) for version history.

---

Expand Down
64 changes: 64 additions & 0 deletions RELEASE_NOTES_v2.15.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Release Notes - v2.15.0

**Release Date:** November 1, 2026

## Overview

v2.15.0 adds the paragraph and table controls needed to generate formatted reports: shaded paragraphs, paragraphs that stay with the next one, table header rows that repeat on every page, rows that never split across pages, and a table of contents that shows a pre-rendered result until Word rebuilds it.

## Interface change: read this before upgrading

New methods were added to two exported interfaces:

- `domain.Paragraph`: `Shading`, `SetShading`, `ClearShading`, `KeepNext`, `SetKeepNext`, `KeepLines`, `SetKeepLines`.
- `domain.TableRow`: `RepeatAsHeader`, `SetRepeatAsHeader`, `CantSplit`, `SetCantSplit`.

If you use only docxgo's own types, nothing changes. If your code defines a type that implements `domain.Paragraph` or `domain.TableRow` (typically a hand-written test double), it stops compiling until you add those methods. Embedding `domain.Paragraph` or `domain.TableRow` in your type avoids the change, because the new methods are promoted automatically.

The only exported function that accepts a caller-provided value of either type is `template.ConsolidateRuns(domain.Paragraph)`. Passing it your own `Paragraph` implementation requires the new methods too.

### Why this is a minor release

These interfaces describe the paragraphs and rows that docxgo creates and returns. They are not an extension point: docxgo has no function that takes your implementation and writes it into a document. Adding a method to this kind of interface is how the library has always grown, and earlier minor releases did the same: `domain.Run.SetLanguage` in v2.12.0, and `AddTable`, `Tables` and `Blocks` on `domain.Header` and `domain.Footer` in v2.13.0. No existing method, signature or behavior of the library's own types changed. Releasing this as a major version would force every user to migrate for a change that only affects code implementing these interfaces itself.

## Upgrade

Go:

```bash
go get github.com/mmonterroca/docxgo/v2@v2.15.0
```

Node.js:

```bash
npm install @mmonterroca/docxgo@2.15.0
```

The complete source diff is available in the [v2.14.0...v2.15.0 comparison](https://github.com/mmonterroca/docxgo/compare/v2.14.0...v2.15.0).

## Highlights

### Paragraph shading

`Paragraph.SetShading(Color)` writes `<w:shd w:val="clear" w:fill="RRGGBB"/>` in `w:pPr`, right after `w:pBdr` as the schema requires. `Shading() (Color, bool)` reports whether a shading is set, which tells "unset" apart from black (`Color`'s zero value). `ClearShading()` removes it. The reader hydrates a source `w:shd` with the same clear/solid rules already used for cell shading. `ParagraphBuilder.Shading(Color)` is the builder entry point.

### Keep with next, keep lines together

`SetKeepNext(bool)` and `SetKeepLines(bool)` write `w:keepNext` and `w:keepLines` right after `w:pStyle`. They keep, for example, an image with its caption on one page. An explicit `false` is written as `w:val="false"`, so it overrides what a style sets. The reader hydrates both. `ParagraphBuilder.KeepNext()` is the builder entry point.

### Repeating header rows and unsplittable rows

`TableRow.SetRepeatAsHeader(true)` writes `w:tblHeader` so Word repeats the row at the top of every page the table spans. `SetCantSplit(true)` writes `w:cantSplit` to keep a row on one page. Both live in `w:trPr`, are hydrated by the reader, and survive the round trip.

### Pre-rendered TOC results

A TOC field now keeps a result set with `SetResult` even while it is dirty. Before, serializing replaced it with the "Table of Contents" placeholder. The field stays dirty, so Word still rebuilds it on open, but your entries show until then. A result containing `\n` is written as one run per line, separated by `w:br`.

## Compatibility

- Interface additions on `domain.Paragraph` and `domain.TableRow`, described above.
- No existing method, signature or default behavior was removed or changed. The one behavior difference is that a dirty TOC field with a caller-set result no longer shows the placeholder text.
- Output is unchanged for documents that do not use the new methods.

Included in #128.
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ This library generates Office Open XML (OOXML) documents compatible with:

# Version

Current version: 2.14.0 (see the Version constant for the authoritative value).
Current version: 2.15.0 (see the Version constant for the authoritative value).

This is a major rewrite of the original go-docx library with breaking changes.
See the migration guide in MIGRATION.md for details.
Expand Down
6 changes: 3 additions & 3 deletions docs/CLI_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Verify the installation:

```bash
docxgo version
# 2.14.0
# 2.15.0
```

---
Expand Down Expand Up @@ -198,7 +198,7 @@ Returns version, protocol version, and platform information.
```json
{
"name": "docxgo",
"version": "2.14.0",
"version": "2.15.0",
"protocolVersion": "1.0",
"goVersion": "go1.23.0",
"platform": "darwin",
Expand Down Expand Up @@ -253,7 +253,7 @@ Executes multiple RPC requests in a single roundtrip. Each sub-request is proces
{
"responses": [
{ "result": { "status": "ok" } },
{ "result": { "name": "docxgo", "version": "2.14.0", ... } },
{ "result": { "name": "docxgo", "version": "2.15.0", ... } },
{ "error": { "code": "NOT_FOUND", "message": "..." } }
]
}
Expand Down
5 changes: 3 additions & 2 deletions docs/IMPLEMENTATION_STATUS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# docxgo v2 Implementation Status

**Last Updated**: August 2026
**Version**: 2.14.0 (Stable)
**Last Updated**: November 2026
**Version**: 2.15.0 (Stable)

This document tracks the implementation status of all v2 features, helping developers understand what's available, what's in progress, and what's planned.

Expand Down Expand Up @@ -44,6 +44,7 @@ All development phases have been completed. The library has gone through multipl
| v2.12.0 | Aug 2026 | `domain.Run.SetLanguage`/`Language` — per-run proofing language override, with `ConsolidateRuns` guarding against merging across a language boundary |
| v2.13.0 | Aug 2026 | Header/footer tables, `Table.SetBorders`, `Run.SetCaps`, full header/footer edit round-trip, table property hydration overhaul, hyperlink/bookmark fidelity (#101), theme-linked cell shading |
| v2.14.0 | Aug 2026 | Lossless `document.xml` round-trip engine, stable row insertion and section edits, QName-safe OOXML handling, tolerant real-world table widths, `CellBuilder.Alignment` (#116-#118) |
| v2.15.0 | Nov 2026 | Paragraph shading, `KeepNext`/`KeepLines`, repeating table header rows and `CantSplit`, TOC fields keep a caller-set result (multi-line results written with `w:br`), builder `Shading()` and `KeepNext()` (#128) |

---

Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,5 @@ See: IMPLEMENTATION_STATUS.md - Features list

---

**Last Updated**: August 2026
**Documentation Version**: v2.14.0
**Last Updated**: November 2026
**Documentation Version**: v2.15.0
8 changes: 4 additions & 4 deletions docs/V2_API_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# docxgo v2 API Guide

**Version**: 2.14.0
**Last Updated**: August 2026
**Version**: 2.15.0
**Last Updated**: November 2026

---

Expand Down Expand Up @@ -1023,5 +1023,5 @@ See [`examples/14_mail_merge/`](../examples/14_mail_merge/) for a complete worki

---

**Last Updated**: August 2026
**Version**: 2.14.0
**Last Updated**: November 2026
**Version**: 2.15.0
8 changes: 4 additions & 4 deletions docs/V2_DESIGN.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# docxgo v2 - Clean Architecture Design

**Status**: ✅ v2.14.0 Stable
**Status**: ✅ v2.15.0 Stable
**Progress**: Production Ready (all core features complete)
**Latest Release**: v2.14.0 (August 2026)
**Latest Release**: v2.15.0 (November 2026)
**Breaking Changes**: Yes (major version bump from original fork)

> **Project Note**: This project is a substantially rewritten successor to `fumiama/go-docx`, focused on clean architecture, type safety, and modern Go practices. The Git history includes AGPL-era upstream snapshots; the completed [provenance audit](./PROVENANCE_AUDIT.md) determines that the current MIT release contains no protectable AGPL implementation.
Expand Down Expand Up @@ -1343,8 +1343,8 @@ See [CREDITS.md](../CREDITS.md) for complete project history.

---

**Last Updated**: August 2026
**Status**: ✅ v2.14.0 Stable
**Last Updated**: November 2026
**Status**: ✅ v2.15.0 Stable
**Progress**: Production Ready (all core features complete)

**Current State:**
Expand Down
2 changes: 1 addition & 1 deletion docx.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func reconstructFromPackage(pkg *reader.Package, op string) (domain.Document, er
}

// Version is the library version.
const Version = "2.14.0"
const Version = "2.15.0"

// Common color constants exported for convenience.
var (
Expand Down
14 changes: 7 additions & 7 deletions npm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mmonterroca/docxgo",
"version": "2.14.0",
"version": "2.15.0",
"description": "Node.js wrapper for docxgo — create and manipulate Word documents via JSON-RPC",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -50,10 +50,10 @@
"typescript": "^5.4.0"
},
"optionalDependencies": {
"@mmonterroca/docxgo-darwin-arm64": "2.14.0",
"@mmonterroca/docxgo-darwin-x64": "2.14.0",
"@mmonterroca/docxgo-linux-arm64": "2.14.0",
"@mmonterroca/docxgo-linux-x64": "2.14.0",
"@mmonterroca/docxgo-win32-x64": "2.14.0"
"@mmonterroca/docxgo-darwin-arm64": "2.15.0",
"@mmonterroca/docxgo-darwin-x64": "2.15.0",
"@mmonterroca/docxgo-linux-arm64": "2.15.0",
"@mmonterroca/docxgo-linux-x64": "2.15.0",
"@mmonterroca/docxgo-win32-x64": "2.15.0"
}
}
Loading