From b571a7550f0ffba26e45ff0ecef4a687f789abb3 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 10 Oct 2019 01:18:20 +0100 Subject: [PATCH] Fix demo --- demo/33-sequential-captions.ts | 50 ++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/demo/33-sequential-captions.ts b/demo/33-sequential-captions.ts index c06c3aa1cc..aed113d0fa 100644 --- a/demo/33-sequential-captions.ts +++ b/demo/33-sequential-captions.ts @@ -1,28 +1,44 @@ // Sequential Captions // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Packer, Paragraph, TextRun } from "../build"; +import { Document, Packer, Paragraph, SequentialIdentifier, TextRun } from "../build"; const doc = new Document(); doc.addSection({ children: [ - new Paragraph("Hello World 1->") - .addSequentialIdentifier("Caption") - .addRun(new TextRun(" text after sequencial caption 2->")) - .addSequentialIdentifier("Caption"), - new Paragraph("Hello World 1->") - .addSequentialIdentifier("Label") - .addRun(new TextRun(" text after sequencial caption 2->")) - .addSequentialIdentifier("Label"), - new Paragraph("Hello World 1->") - .addSequentialIdentifier("Another") - .addRun(new TextRun(" text after sequencial caption 3->")) - .addSequentialIdentifier("Label"), - new Paragraph("Hello World 2->") - .addSequentialIdentifier("Another") - .addRun(new TextRun(" text after sequencial caption 4->")) - .addSequentialIdentifier("Label"), + new Paragraph({ + children: [ + new TextRun("Hello World 1->"), + new SequentialIdentifier("Caption"), + new TextRun(" text after sequencial caption 2->"), + new SequentialIdentifier("Caption"), + ], + }), + new Paragraph({ + children: [ + new TextRun("Hello World 1->"), + new SequentialIdentifier("Label"), + new TextRun(" text after sequencial caption 2->"), + new SequentialIdentifier("Label"), + ], + }), + new Paragraph({ + children: [ + new TextRun("Hello World 1->"), + new SequentialIdentifier("Another"), + new TextRun(" text after sequencial caption 3->"), + new SequentialIdentifier("Label"), + ], + }), + new Paragraph({ + children: [ + new TextRun("Hello World 2->"), + new SequentialIdentifier("Another"), + new TextRun(" text after sequencial caption 4->"), + new SequentialIdentifier("Label"), + ], + }), ], });