Skip to content

Commit

Permalink
Merge pull request #661 from gotson/feat/gh640-landmarks
Browse files Browse the repository at this point in the history
get landmarks from the reader instance
  • Loading branch information
aferditamuriqi authored Nov 15, 2023
2 parents ea95e4f + 7b2ed1c commit 464242e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/navigator/IFrameNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,9 @@ export class IFrameNavigator extends EventEmitter implements Navigator {
tableOfContents(): any {
return this.publication.tableOfContents;
}
landmarks(): any {
return this.publication.landmarks;
}
readingOrder(): any {
return this.publication.readingOrder;
}
Expand Down
1 change: 1 addition & 0 deletions src/navigator/Navigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ interface Navigator {
deactivateMarker?(): any;

tableOfContents(): any;
landmarks(): any;

readingOrder(): any;

Expand Down
1 change: 1 addition & 0 deletions src/navigator/PDFNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export class PDFNavigator extends EventEmitter implements Navigator {
tableOfContents(): any {
return this.publication.tableOfContents;
}
landmarks(): any {};

//TODO:
currentResource(): any {}
Expand Down
4 changes: 4 additions & 0 deletions src/reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,10 @@ export default class D2Reader {
get tableOfContents() {
return convertAndCamel(this.navigator.tableOfContents()) ?? [];
}
/** Landmarks */
get landmarks() {
return convertAndCamel(this.navigator.landmarks()) ?? [];
}
/** Reading Order or Spine */
get readingOrder() {
return convertAndCamel(this.navigator.readingOrder()) ?? [];
Expand Down

0 comments on commit 464242e

Please sign in to comment.