Deploy dolanmiu/docx to github.com/dolanmiu/docx.git:gh-pages

This commit is contained in:
Deployment Bot (from Travis CI)
2021-06-01 00:16:45 +00:00
parent 812e8111db
commit 1a00270fa8
309 changed files with 6827 additions and 16546 deletions

View File

@ -12,14 +12,29 @@ The complete documentation can be found [here](https://www.ecma-international.or
All you need to do is create a `TableOfContents` object and assign it to the document.
```ts
const toc = new TableOfContents("Summary", {
hyperlink: true,
headingStyleRange: "1-5",
stylesWithLevels: [new StyleLevel("MySpectacularStyle", 1)],
});
**Note**: updateFields feature must be enabled for TableOfContents to update correctly.
doc.addTableOfContents(toc);
```ts
const doc = new Document({
features: {
updateFields: true,
},
sections: [
{
children: [
new TableOfContents("Summary", {
hyperlink: true,
headingStyleRange: "1-5",
}),
new Paragraph({
text: "Header #1",
heading: HeadingLevel.HEADING_1,
pageBreakBefore: true,
}),
]
}
]
});
```
## Table of Contents Options