Fix demo
This commit is contained in:
@ -1,28 +1,44 @@
|
|||||||
// Sequential Captions
|
// Sequential Captions
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
// Import from 'docx' rather than '../build' if you install from npm
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, Packer, Paragraph, TextRun } from "../build";
|
import { Document, Packer, Paragraph, SequentialIdentifier, TextRun } from "../build";
|
||||||
|
|
||||||
const doc = new Document();
|
const doc = new Document();
|
||||||
|
|
||||||
doc.addSection({
|
doc.addSection({
|
||||||
children: [
|
children: [
|
||||||
new Paragraph("Hello World 1->")
|
new Paragraph({
|
||||||
.addSequentialIdentifier("Caption")
|
children: [
|
||||||
.addRun(new TextRun(" text after sequencial caption 2->"))
|
new TextRun("Hello World 1->"),
|
||||||
.addSequentialIdentifier("Caption"),
|
new SequentialIdentifier("Caption"),
|
||||||
new Paragraph("Hello World 1->")
|
new TextRun(" text after sequencial caption 2->"),
|
||||||
.addSequentialIdentifier("Label")
|
new SequentialIdentifier("Caption"),
|
||||||
.addRun(new TextRun(" text after sequencial caption 2->"))
|
],
|
||||||
.addSequentialIdentifier("Label"),
|
}),
|
||||||
new Paragraph("Hello World 1->")
|
new Paragraph({
|
||||||
.addSequentialIdentifier("Another")
|
children: [
|
||||||
.addRun(new TextRun(" text after sequencial caption 3->"))
|
new TextRun("Hello World 1->"),
|
||||||
.addSequentialIdentifier("Label"),
|
new SequentialIdentifier("Label"),
|
||||||
new Paragraph("Hello World 2->")
|
new TextRun(" text after sequencial caption 2->"),
|
||||||
.addSequentialIdentifier("Another")
|
new SequentialIdentifier("Label"),
|
||||||
.addRun(new TextRun(" text after sequencial caption 4->"))
|
],
|
||||||
.addSequentialIdentifier("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"),
|
||||||
|
],
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user