first simple version of TOC working
This commit is contained in:
13
src/file/table-of-contents/instruction.ts
Normal file
13
src/file/table-of-contents/instruction.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
class TextAttributes extends XmlAttributeComponent<{ space: "default" | "preserve" }> {
|
||||
protected xmlKeys = { space: "xml:space" };
|
||||
}
|
||||
|
||||
export class TableOfContentsInstruction extends XmlComponent {
|
||||
constructor() {
|
||||
super("w:instrText");
|
||||
this.root.push(new TextAttributes({ space: "preserve" }));
|
||||
this.root.push("TOC");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user