docs: point the README's Node examples at demo/ instead of RunKit (#3906)

* docs: point the README's Node examples at demo/ instead of RunKit

runkit.com no longer serves the demos: its TLS certificate expired on
2026-01-18 and the site answers 503. Link the equivalent files in demo/
and say how to run them.

* docs: say the demos need a build, and where they write the document

The demos that import docx/shapes, docx/charts, docx/html, docx/layout and
the other subpath entries (51 of the 172) load them from dist/, so in a
fresh clone they stop with ERR_MODULE_NOT_FOUND until `npm run build` has
run. CI builds before it runs the demos too.

npm runs scripts from the package's folder, so the document is written to
the root of the repository, whichever folder the command is run from.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* docs: link the demos that the RunKit Margins and Advanced paragraphs links ran

RunKit's demo 6, "Margins", was demo/demo6.js, which sets the page's
margins to zero. It is demo/page-layout/page-borders.ts now, and still
does that, so the list keeps it.

RunKit's demo 2, "Advanced Paragraphs and text", was demo/demo2.js, with
its own heading and paragraph styles and numbering. It is
demo/styles/default-styles.ts now, so the list links that, in place of the
paragraph spacing demo.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: fstandhartinger <florian.standhartinger@gmail.com>
Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Florian Standhartinger
2026-11-19 03:05:30 +00:00
committed by GitHub
co-authored by Claude Fable 5.2 fstandhartinger Dolan Miu
parent dc8bd21a0c
commit f760d3281c
+10 -14
View File
@@ -77,21 +77,17 @@ Here is an example of `docx` working in `Vue.js`:
## Node
Press `endpoint` on the `RunKit` website:
Runnable examples live in [`demo/`](https://github.com/dolanmiu/docx/tree/master/demo), grouped by topic. In a clone of this repository, after `npm install` and `npm run build`, run one with `npm run run-ts -- ./demo/<topic>/<demo>.ts`; it writes `My Document.docx` to the root of the repository.
![RunKit Instructions](https://user-images.githubusercontent.com/2917613/38582539-f84311b6-3d07-11e8-90db-5885ae02c3c4.png)
- https://runkit.com/dolanmiu/docx-demo1 - Simple paragraph and text
- https://runkit.com/dolanmiu/docx-demo2 - Advanced Paragraphs and text
- https://runkit.com/dolanmiu/docx-demo3 - Bullet points
- https://runkit.com/dolanmiu/docx-demo4 - Simple table
- https://runkit.com/dolanmiu/docx-demo5 - Images
- https://runkit.com/dolanmiu/docx-demo6 - Margins
- https://runkit.com/dolanmiu/docx-demo7 - Landscape
- https://runkit.com/dolanmiu/docx-demo8 - Header and Footer
- https://runkit.com/dolanmiu/docx-demo10 - **My CV generated with docx**
More [here](https://github.com/dolanmiu/docx/tree/master/demo)
- [`demo/getting-started/basic-document.ts`](https://github.com/dolanmiu/docx/blob/master/demo/getting-started/basic-document.ts) - Simple paragraph and text
- [`demo/styles/default-styles.ts`](https://github.com/dolanmiu/docx/blob/master/demo/styles/default-styles.ts) - Advanced paragraphs and text
- [`demo/lists/numbering-and-bullet-points.ts`](https://github.com/dolanmiu/docx/blob/master/demo/lists/numbering-and-bullet-points.ts) - Bullet points and numbering
- [`demo/tables/basic-table.ts`](https://github.com/dolanmiu/docx/blob/master/demo/tables/basic-table.ts) - Simple table
- [`demo/images/images.ts`](https://github.com/dolanmiu/docx/blob/master/demo/images/images.ts) - Images
- [`demo/page-layout/page-borders.ts`](https://github.com/dolanmiu/docx/blob/master/demo/page-layout/page-borders.ts) - Margins
- [`demo/page-layout/landscape.ts`](https://github.com/dolanmiu/docx/blob/master/demo/page-layout/landscape.ts) - Landscape
- [`demo/headers-and-footers/header-and-footer.ts`](https://github.com/dolanmiu/docx/blob/master/demo/headers-and-footers/header-and-footer.ts) - Header and Footer
- [`demo/getting-started/cv.ts`](https://github.com/dolanmiu/docx/blob/master/demo/getting-started/cv.ts) - **My CV generated with docx**
# How to use & Documentation