Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for paged.js hooks (closes #512) #513

Merged
merged 3 commits into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,11 @@ The scope defines if the docinfo files apply for a specific document ("private")
| ----- | -------- | -------- | ----------------- |
| Private | Head | Adds content to `<head>` for `<docname>.adoc` files. | `<docname>-docinfo-pdf.html` |
| Private | Header | Adds content to start of document for `<docname>.adoc` files. | `<docname>-docinfo-header-pdf.html` |
| Private | Footer | Adds content to end of document for `<docname>.adoc` files. | `<docname>-docinfo-footer-pdf.html` |
| Private | Footer | Adds content to end of document for `<docname>.adoc` files. Useful for supporting [pagedjs.js hooks and custom javascript](https://www.pagedjs.org/documentation/11-hooks/) | `<docname>-docinfo-footer-pdf.html` |
ggrossetie marked this conversation as resolved.
Show resolved Hide resolved
| Private | Running | Adds running content to start of document for `<docname>.adoc` files. | `<docname>-docinfo-running-pdf.html` |
| Shared | Head | Adds content to `<head>` for any document in same directory. | `docinfo-pdf.html` |
| Shared | Header | Adds content to start of document for any document in same directory. | `docinfo-header-pdf.html` |
| Shared | Footer | Adds content to end of document for any document in same directory. | `docinfo-footer-pdf.html` |
| Shared | Footer | Adds content to end of document for any document in same directory. Useful for supporting [pagedjs.js hooks and custom javascript](https://www.pagedjs.org/documentation/11-hooks/)| `docinfo-footer-pdf.html` |
ggrossetie marked this conversation as resolved.
Show resolved Hide resolved
| Shared | Running | Adds running content to start for any document in same directory. | `docinfo-running-pdf.html` |

To specify which file(s) you want to apply, set the docinfo attribute to any combination of these values:
Expand All @@ -349,6 +349,8 @@ For example:

This docinfo configuration will apply the shared docinfo head, header, running and footer files, if they exist, as well as the private footer file, if it exists.



ggrossetie marked this conversation as resolved.
Show resolved Hide resolved
#### Running elements

Running elements can be positioned on the [top, bottom, left or right margins of pages](https://www.w3.org/TR/css-page-3/#margin-boxes).
Expand Down
2 changes: 1 addition & 1 deletion lib/document/document-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ ${this.outline(node, opts)}
${this.tocHeader(node, opts)}
${contentHTML}
${this.footnotes(node)}
${this.docinfoContent(node, 'footer', '-pdf.html')}
${this.syntaxHighlighterFooter(node, syntaxHighlighter, { cdn_base_url: cdnBaseUrl, linkcss: linkcss, self_closing_tag_slash: '/' })}
${this.stemContent.content(node)}
<script>
${this.pagedContent}
${this.pagedRendering}
${this.repeatTableElementsContent}
</script>
${this.docinfoContent(node, 'footer', '-pdf.html')}
</body>
</html>`
}
Expand Down