sioyek icon indicating copy to clipboard operation
sioyek copied to clipboard

[Feature request] An optional feature to always display the table of contents (TOC) when skimming documents

Open temberature opened this issue 2 years ago • 4 comments

In my experience, always having the table of contents (TOC) visible is helpful when scanning or skimming documents. Because of this, the availability of the TOC is a key factor for me when choosing a PDF reader. sioyek's text-to-speech (TTS) function is unique, so I'm interested in switching to it. However, I'm wondering if it's possible to easily access the TOC whenever needed in sioyek.

Three solutions come to mind:

  1. displaying the TOC breadcrumb in the status bar,
  2. providing parameters to set the TOC's position and width, and the user can change focus to the main document without hiding TOC. If it's convenient, the TOC highlighted item can sync to document progress.
  3. adding a side pane for the TOC like common readers.

These solutions would require varying amounts of coding to implement, but they could make it easier to access and navigate the TOC in sioyek. Finally, no matter what, thanks for your time.

WX20221210-141007 WX20221210-141113

temberature avatar Dec 10 '22 06:12 temberature

how could i go about implementing the side pane option? I'm not sure if it could be done using the python extensions. pointers to the relevant file or docs would be great. thanks.

Arun-42 avatar Jun 14 '24 08:06 Arun-42

It is not possible to implement using python extensions.

ahrm avatar Jun 14 '24 08:06 ahrm

Cool. Could you point me to the relevant files/docs for implementing this.

If the clean way to do it is high-effort, it would still be great to get something hacky working for myself. Thank you.

Arun-42 avatar Jun 14 '24 10:06 Arun-42

The main file you have to modify is MainWidget.cpp. You probably need to modify the QLayout and add an instance of the toc ui to the layout (see the function handle_goto_toc).

ahrm avatar Jun 14 '24 10:06 ahrm