diff options
Diffstat (limited to 'lib/documents.js')
| -rw-r--r-- | lib/documents.js | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/documents.js b/lib/documents.js index 12ebc73..f293ec3 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -6,13 +6,16 @@ var types = { tab: "tab", hyperlink: "hyperlink", footnoteReference: "footnoteReference", - image: "image" + image: "image", + footnote: "footnote" }; -function Document(children) { +function Document(children, options) { + options = options || {}; return { type: types.document, - children: children + children: children, + footnotes: options.footnotes || [] }; } @@ -64,11 +67,18 @@ function Hyperlink(children, options) { function FootnoteReference(options) { return { type: types.footnoteReference, - id: options.id, - body: options.body + footnoteNumber: options.footnoteNumber }; } +function Footnote(options) { + return { + type: types.footnote, + body: options.body, + footnoteNumber: options.footnoteNumber + }; +}; + function ElementWithChildren(type) { return function(children, properties) { return { @@ -95,4 +105,5 @@ exports.Text = Text; exports.Tab = Tab; exports.Hyperlink = Hyperlink; exports.FootnoteReference = FootnoteReference; +exports.Footnote = Footnote; exports.Image = Image; |
