diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-06-10 15:22:36 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-06-10 15:22:36 +0100 |
| commit | 03293a8e2265dd84eb05a31b8100cf1a310c51bb (patch) | |
| tree | 4d87de615c8fcd81ebeb88b4e1f29d79568ebce5 /lib/documents.js | |
| parent | 8be57d82ffae15aa753ca57ce19c581bf0d6b897 (diff) | |
Add basic footnote output
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; |
