Use context in prep xml

This commit is contained in:
Dolan
2021-03-11 01:06:55 +00:00
parent cf6c4998d0
commit 566ac03f9a
16 changed files with 216 additions and 87 deletions

View File

@ -4,20 +4,24 @@ import * as fs from "fs";
import { Document, ExternalHyperlink, Footer, FootnoteReferenceRun, Media, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({
footnotes: [
new Paragraph({
footnotes: {
1: {
children: [
new TextRun("Click here for the "),
new ExternalHyperlink({
child: new TextRun({
text: "Footnotes external hyperlink",
style: "Hyperlink",
}),
link: "http://www.example.com",
new Paragraph({
children: [
new TextRun("Click here for the "),
new ExternalHyperlink({
child: new TextRun({
text: "Footnotes external hyperlink",
style: "Hyperlink",
}),
link: "http://www.example.com",
}),
],
}),
],
}),
],
},
},
});
const image1 = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg"));
@ -69,7 +73,7 @@ doc.addSection({
}),
link: "http://www.example.com",
}),
new FootnoteReferenceRun(1)
new FootnoteReferenceRun(1),
],
}),
new Paragraph({

View File

@ -27,25 +27,29 @@ import {
*/
const doc = new Document({
footnotes: [
new Paragraph({
footnotes: {
1: {
children: [
new TextRun("This is a footnote"),
new DeletedTextRun({
text: " with some extra text which was deleted",
id: 0,
author: "Firstname Lastname",
date: "2020-10-06T09:05:00Z",
}),
new InsertedTextRun({
text: " and new content",
id: 1,
author: "Firstname Lastname",
date: "2020-10-06T09:05:00Z",
new Paragraph({
children: [
new TextRun("This is a footnote"),
new DeletedTextRun({
text: " with some extra text which was deleted",
id: 0,
author: "Firstname Lastname",
date: "2020-10-06T09:05:00Z",
}),
new InsertedTextRun({
text: " and new content",
id: 1,
author: "Firstname Lastname",
date: "2020-10-06T09:05:00Z",
}),
],
}),
],
}),
],
},
},
features: {
trackRevisions: true,
},