Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 1.08 KB

README.MD

File metadata and controls

19 lines (11 loc) · 1.08 KB

CETEIcean Pagination Example

This example shows one possible approach to paginating TEI documents rendered with CETEIcean.

It uses document.createTreeWalker() to hide text content inside <tei:text> before the nth <tei:pb/> and after the following <tei:pb/>.

Gotchas

  • We assume the first <tei:pb/> is placed at the beginnig of the document (pb stands for 'page beginning').
  • If no <tei:pb/> is present, we show the whole document.
  • The content of text nodes is copied to a new property on the HTML text node object. This is a bit of a hack, but works for this example

Suggestions for integration

This code is mostly meant as an example rather than being capable to work in production. In particular, we would suggest using a framework to manage the navigation component and react to changes in data (e.g. which page is visible) as opposed to checking and updating global flags.

License

CC0