24 Commits
Author SHA1 Message Date
DolanandClaude Opus 5.5 c169dd1a83 feat: live examples in the docs, which run, draw the document next to the code, and can be edited and downloaded (#3556)
* feat: live examples in the docs, which run, draw the document next to the code, and can be edited and downloaded

The docs' code examples were plain snippets, often fragments that couldn't run. A code block marked ```ts live is now
an example readers can see and change: the page runs it with docx, draws the document it makes next to the code with
docx-preview, and offers the .docx to download. Clicking the code opens an editor (Monaco) that knows docx's types,
the pages are drawn again as the code changes, and View closes the editor. Split, Code and Preview show the code and
the pages side by side, or one of them. The demos a page includes are live too.

Every example in the docs that builds or patches a document is now live: 443 of them, each a whole file with its
imports, so it runs as written. Code about other things, such as installing, bundlers or servers, stays plain.

Running them showed docs that were wrong, fixed here:
- Landscape: docx swaps a landscape page's width and height itself, so the docs' swapped sizes made a tall page
  marked as landscape
- Comments: `comments.children` takes plain objects, not `new Comment(...)`
- Custom properties are text only
- APIs that no longer exist: MathText, Row, `.then` on Packer.toStream, patchDocument(buffer, ...),
  createParagraph().heading1(), a border's `value`, TextRun's `.break()`
- The templates and patcher examples read files that aren't in the repository. They now patch the templates in
  demo/assets, or make their own

`npm run build.docs` copies docx's browser builds into docs/live-examples/lib, so the docs use the docx they
describe, and the Pages workflow runs it. The folder is gitignored, and cspell and ESLint skip it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TmyffPd5QMJYjXiMBQ3EnZ

* docs: the bullet examples draw a bullet, and the patcher's usage writes the patched document

"ὠ" is U+1F60, a Greek omega, since \u takes four hex digits, so the two live bullet examples on
the numbering page drew it as each item's bullet. They use "•" now. The patcher's usage example
now awaits patchDocument and writes the document it makes, as the example after it does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TmyffPd5QMJYjXiMBQ3EnZ

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 13:00:29 +01:00
Dolan 6207d0067f feat: native Word charts in docx/charts (#3545) 2026-09-26 10:15:50 +01:00
Dolan 494ed78138 feat: shapes in docx/shapes and watermarks in docx/watermarks (#3534) 2026-09-24 15:38:43 +01:00
Dolan 3bd3afd6e4 feat: add shapes with ShapeRun and ShapeGroupRun (#3521)
* feat: Add shapes

* Make API more friendly
2026-09-24 01:54:16 +01:00
Dolan 3539c06e92 docs: Improve inline docs and docs website (#3353)
* docs: Improve inline docs and docs website

* Fix lint

* Fix spelling
2026-02-14 03:54:25 +00:00
Dolan Miu a368ed7fd3 Add docsify-terminal-block to documentation 2023-06-15 21:29:10 +01:00
Dolan Miu 64addc85ee Fix all spelling across the project 2022-07-06 14:05:37 +01:00
1shaked 7fa94b6996 Update README.md
fix typing error with the extra ;
2021-08-29 09:43:09 +03:00
Dolan 3299c557a0 Make .addSection fully declarative 2021-03-19 20:53:56 +00:00
Dolan d45213636c Add Clippy to readme 2020-09-05 18:41:24 +01:00
Jan Marten 05dda37b71 Fix comment regarding output file name 2020-08-06 08:56:02 +00:00
Dolan Miu 41acb475a9 Update documentation 2020-07-30 11:42:55 +01:00
Dolan 7dfb016faa Make tab and page numbers declarative 2019-11-21 01:02:46 +00:00
Dolan d8b60d82f3 Turn Packer static 2019-08-07 22:12:14 +01:00
Dolan Miu 820e5edc1e Using const rather than var and let, and using ts rather than js examples 2019-08-06 17:51:13 +01:00
Dolan c2c05b0140 Adding some documentation 2019-08-03 13:42:24 +01:00
Dolan e2574ec23b Turn methods into "add()" 2019-06-25 23:17:56 +01:00
Matt Hillsdon 149cda9a3b Fix getting started docs for v4 packer. 2019-01-02 15:56:13 +00:00
Dolan a601a82a37 Updated logo dimensions 2018-09-11 19:16:47 +01:00
Dolan 6c2f335a31 Add new slogan 2018-08-21 22:29:40 +01:00
Dolan e9ea4845be Improve README 2018-08-09 03:13:16 +01:00
Dolan 7d05d69707 Update documentation and README 2018-08-04 04:03:08 +01:00
Dolan 7d116d1ce9 Add more documentation 2018-08-04 03:28:27 +01:00
Dolan 73267ac4e5 Add docsify documentation 2018-08-03 23:26:14 +01:00