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:
Sergio Mendonça
2018-09-10 10:01:26 -03:00
parent aedfca377f
commit 146d0ad9e5
13 changed files with 268 additions and 14 deletions

View File

@ -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);