Skip to content

pages

The community/tags/pages directory defines a user.pages tag, which is intended to be used for applications or contexts that support page navigation.

The core logic is defined in pages.py. This file defines the user.pages tag and an action class that includes the following actions:

  • page_current() -> int: Returns the current page number.
  • page_next(): Navigates to the next page. It does this by calling actions.user.page_jump with the current page number + 1.
  • page_previous(): Navigates to the previous page. It does this by calling actions.user.page_jump with the current page number - 1.
  • page_jump(number: int): Navigates to a specific page number.
  • page_final(): Navigates to the final page.
  • page_rotate_right(): Rotates the document 90 degrees to the right.
  • page_rotate_left(): Rotates the document 90 degrees to the left.

Note that page_current and page_jump are intended to be overridden by other files.

pages.talon defines voice commands that use the actions defined in pages.py. Notably, it also includes the line tag(): user.navigation which causes the user.navigation tag to be enabled whenever the user.pages tag is enabled. This will often result in other files becoming active. The following commands are defined:

  • page next: Calls user.page_next().
  • page last: Calls user.page_previous().
  • go page <number>: Calls user.page_jump(number).
  • go page final: Calls user.page_final().
  • rotate right: Calls user.page_rotate_right().
  • rotate left: Calls user.page_rotate_left().

In summary, this directory provides a base set of actions and voice commands for applications that involve page navigation. The user.pages tag activates these commands in the appropriate contexts.