Merge branch 'master' into feat/new-template
This commit is contained in:
@ -88,6 +88,7 @@ Read the contribution guidelines [here](https://docx.js.org/#/contribution-guide
|
||||
[<img src="https://i.imgur.com/cmykN7c.png" alt="drawing"/>](https://www.arity.co/)
|
||||
[<img src="https://i.imgur.com/PXo25um.png" alt="drawing" height="50"/>](https://www.circadianrisk.com/)
|
||||
[<img src="https://i.imgur.com/AKGhtlh.png" alt="drawing"/>](https://lexense.com/)
|
||||
[<img src="https://i.imgur.com/9tqJaHw.png" alt="drawing" height="50"/>](https://novelpad.co/)
|
||||
|
||||
...and many more!
|
||||
|
||||
|
42
docs/usage/footnotes.md
Normal file
42
docs/usage/footnotes.md
Normal file
@ -0,0 +1,42 @@
|
||||
# Footnotes
|
||||
|
||||
!> Footnotes requires an understanding of [Sections](usage/sections.md).
|
||||
|
||||
Use footnotes and endnotes to explain, comment on, or provide references to something in a document. Usually, footnotes appear at the bottom of the page.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
const doc = new Document({
|
||||
footnotes: {
|
||||
1: { children: [new Paragraph("Foo"), new Paragraph("Bar")] },
|
||||
2: { children: [new Paragraph("Test")] },
|
||||
},
|
||||
sections: [
|
||||
{
|
||||
children: [
|
||||
new Paragraph({
|
||||
children: [
|
||||
new TextRun({
|
||||
children: ["Hello"],
|
||||
}),
|
||||
new FootnoteReferenceRun(1),
|
||||
new TextRun({
|
||||
children: [" World!"],
|
||||
}),
|
||||
new FootnoteReferenceRun(2),
|
||||
],
|
||||
}),
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Footnotes requires an entry into the `footnotes` array in the `Document` constructor, and a `FootnoteReferenceRun` in the `Paragraph` constructor.
|
||||
|
||||
`footnotes` is an object of number to `Footnote` objects. The number is the reference number, and the `Footnote` object is the content of the footnote. The `Footnote` object has a `children` property, which is an array of `Paragraph` objects.
|
||||
|
||||
`FootnoteReferenceRun` is a `Run` object, which are added to `Paragraph`s. It takes a number as a parameter, which is the reference number of the footnote.
|
881
package-lock.json
generated
881
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -81,7 +81,7 @@
|
||||
"eslint": "^8.23.0",
|
||||
"eslint-plugin-functional": "^5.0.1",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-jsdoc": "^39.3.6",
|
||||
"eslint-plugin-jsdoc": "^40.0.0",
|
||||
"eslint-plugin-no-null": "^1.0.2",
|
||||
"eslint-plugin-prefer-arrow": "^1.2.3",
|
||||
"eslint-plugin-unicorn": "^45.0.0",
|
||||
|
Reference in New Issue
Block a user