Make create footnote declarative

This commit is contained in:
Dolan
2019-12-03 23:04:48 +00:00
parent 2b0953bb19
commit 2bece0bb61
4 changed files with 216 additions and 13 deletions

View File

@ -67,6 +67,7 @@ export class File {
creator: "Un-named",
revision: "1",
lastModifiedBy: "Un-named",
footnotes: [],
},
fileProperties: IFileProperties = {},
sections: ISectionOptions[] = [],
@ -136,6 +137,12 @@ export class File {
this.document.add(child);
}
}
if (options.footnotes) {
for (const paragraph of options.footnotes) {
this.footNotes.createFootNote(paragraph);
}
}
}
public createHyperlink(link: string, text?: string): Hyperlink {
@ -191,10 +198,6 @@ export class File {
}
}
public createFootnote(paragraph: Paragraph): void {
this.footNotes.createFootNote(paragraph);
}
public verifyUpdateFields(): void {
if (this.document.getTablesOfContents().length) {
this.settings.addUpdateFields();