feat(textRun): implemented footnote references on the text run element
This commit is contained in:
@ -1,14 +1,20 @@
|
||||
// Footnotes
|
||||
// Import from 'docx' rather than '../build' if you install from npm
|
||||
import * as fs from "fs";
|
||||
import { Document, Packer, Paragraph } from "../build";
|
||||
import { Document, Packer, Paragraph, TextRun } from "../build";
|
||||
|
||||
const doc = new Document();
|
||||
|
||||
doc.addSection({
|
||||
children: [new Paragraph("Hello World").referenceFootnote(1), new Paragraph("Hello World").referenceFootnote(2)],
|
||||
children: [
|
||||
new Paragraph({
|
||||
children: [new TextRun("Hello").referenceFootnote(1), new TextRun(" World!").referenceFootnote(2)],
|
||||
}),
|
||||
new Paragraph("Hello World").referenceFootnote(3),
|
||||
],
|
||||
});
|
||||
|
||||
doc.createFootnote(new Paragraph("Foo"));
|
||||
doc.createFootnote(new Paragraph("Test"));
|
||||
doc.createFootnote(new Paragraph("My amazing reference"));
|
||||
|
||||
|
Reference in New Issue
Block a user