Add footnote support to API

This commit is contained in:
Dolan
2018-06-25 19:49:46 +01:00
parent 369ec9c30b
commit 99290d646e
6 changed files with 37 additions and 12 deletions

View File

@ -1,6 +1,8 @@
import { XmlComponent } from "file/xml-components";
import { Paragraph } from "../paragraph";
import { FootNote } from "./footnote/footnote";
import { ContinuationSeperatorRun } from "./footnote/run/continuation-seperator-run";
import { SeperatorRun } from "./footnote/run/seperator-run";
import { FootnotesAttributes } from "./footnotes-attributes";
export class FootNotes extends XmlComponent {
@ -28,32 +30,30 @@ export class FootNotes extends XmlComponent {
}),
);
const begin = new FootNote(-1);
const begin = new FootNote(-1, "separator");
begin.addParagraph(
new Paragraph().spacing({
after: 0,
line: 240,
lineRule: "auto",
}),
}).addRun(new SeperatorRun()),
);
this.root.push(begin);
const spacing = new FootNote(0);
const spacing = new FootNote(0, "continuationSeparator");
spacing.addParagraph(
new Paragraph().spacing({
after: 0,
line: 240,
lineRule: "auto",
}),
}).addRun(new ContinuationSeperatorRun()),
);
this.root.push(spacing);
}
public createFootNote(): void {
// TODO
}
public getFootNote(): void {
// TODO
public createFootNote(paragraph: Paragraph): void {
const footnote = new FootNote(1);
footnote.addParagraph(paragraph);
this.root.push(footnote);
}
}