Moved addTableOfContents to File and creating a settings.xml and applying updateFields=true when there is a table of contents
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { Paragraph } from "../paragraph";
|
||||
import { Table } from "../table";
|
||||
import { TableOfContents } from "../table-of-contents";
|
||||
import { Body } from "./body";
|
||||
import { SectionPropertiesOptions } from "./body/section-properties";
|
||||
import { DocumentAttributes } from "./document-attributes";
|
||||
@ -41,6 +42,11 @@ export class Document extends XmlComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
public addTableOfContents(toc: TableOfContents): Document {
|
||||
this.body.push(toc);
|
||||
return this;
|
||||
}
|
||||
|
||||
public createParagraph(text?: string): Paragraph {
|
||||
const para = new Paragraph(text);
|
||||
this.addParagraph(para);
|
||||
|
Reference in New Issue
Block a user