Skip to content

Commit

Permalink
Add new commands and configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrm committed Feb 17, 2022
1 parent b6ff339 commit 439385f
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 6 deletions.
67 changes: 65 additions & 2 deletions docs/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Prefrences in :code:`prefs.config` file

:code:`background_color`
^^^^^^^^^^^^^^^^^^^^^^^^
Specifies the background color of the app (this is different from the background color of PDF page, this color is only shown when the displayed page is smaller than the srceen). The syntax to set colors is:
Specifies the background color of the app (this is different from the background color of PDF page which is configured using :ref:`customcolor`, this color is only shown when the displayed page is smaller than the srceen). The syntax to set colors is:

.. code-block:: console
Expand Down Expand Up @@ -185,6 +185,16 @@ If set, we display a checkerboard pattern for unrendered pages (by default we di

Displays an overview of destination when hovering over a link with mouse.

:code:`rerender_overview`
^^^^^^^^^^^^^^^^^^^^^^^^^

Normally we reuse the rendered page for overview window. This may cause the overview page to be blurry or too sharp if there is a significant difference between the zoom levels of the main window and overview window.
If :code:`rerender_overview` is set, we rerender overview which solves this issue at the cost of some additional computation.

.. code-block:: console
rerender_overview 1
:code:`default_dark_mode`
^^^^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -205,6 +215,36 @@ The path of :code:`shared.db` database file. You can set this path to be in a sy

Size of the UI font.

:code:`ui_font`
^^^^^^^^^^^^^^^^^^^^^^^^

The font to use for UI text.

.. code-block:: console
ui_font Segoe UI Emoji
:code:`item_list_prefix`
^^^^^^^^^^^^^^^^^^^^^^^^

A prefix character to use before list of items (for example can be used to display a checkmark before each of the bookmarks).

.. code-block:: console
item_list_prefix ✔️
:code:`check_for_updates_on_startup`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If set, sioyek checkes for new versions on startup and notifies the user if a new version if available.

.. code-block:: console
check_for_updates_on_startup 1
.. _customcolor:

:code:`custom_background_color` and :code:`custom_text_color`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -222,4 +262,27 @@ Semicolon-separated list of commands to execute on startup. For example, to star

.. code-block:: console
startup_commands toggle_custom_color;toggle_visual_scroll
startup_commands toggle_custom_color;toggle_visual_scroll
:code:`status_bar_color`, :code:`status_bar_text_color` and :code:`status_bar_font_size`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Allow you to customize the appearance of status bar.

.. code-block:: console
status_bar_color 0 0 0
status_bar_text_color 1 1 1
status_bar_font_size 10
:code:`execute_command_a` to :code:`execute_command_z`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Predefined shell commands to be executed using :code:`execute_predefined_command`. :code:`%1` expands to the path of the current file and :code:`%2` expands to name of the current file.
For example, suppose you have a command named :code:`ocr` which takes a file path and produces an OCR'd version of the document. You can add the following to you :code:`prefs_user.config`:

.. code-block:: console
execute_command_o ocr "%1"
You can later quickly invoke this command by executing :code:`execute_predefined_command` and then pressing :code:`o`.
15 changes: 11 additions & 4 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ For example suppose you want to use the :code:`j` key to move down. You can add
move_down j
You can press :code:`:` to open a searchable list of all available commands.


Opening Files
^^^^^^^^^^^^^

- Press :code:`o` to open the select file menu. (:code:`open_document` command)
- Press :code:`<Shift o>` (:code:`O`) to open a searchable list of recently opened files. (:code:`open_prev_doc` command)
- Press :code:`<Ctrl o>` to open an embedded file system browser. (:code:`open_document_embedded` command)
- Press :code:`<Ctrl Shift o>` to open an embedded file system browser rooted in the current document folder. (:code:`open_document_embedded_from_current_path` command)


Basic Movement
Expand Down Expand Up @@ -81,7 +84,7 @@ If you right click on a line of text in a PDF file, sioyek displays a visual hig
2. It highlights the current line being read which reduces eye strain and prevents losing your place in PDF files.

- You can move the visual mark to the next/previous line by pressing :code:`j`/:code:`k` (:code:`move_visual_mark_down` and :code:`move_visual_mark_up` commands).
- You can toggle visual scroll mode by pressing :code:`f7`. In this mode, mouse wheel moves the visual mark up and down.
- You can toggle visual scroll mode by pressing :code:`f7` (:code:`toggle_visual_scroll` command). In this mode, mouse wheel moves the visual mark up and down.

Search
^^^^^^
Expand Down Expand Up @@ -115,7 +118,7 @@ Bookmarks are similar to marks except they use a textual description instead of
- You can add a bookmark by pressing :code:`b` (:code:`add_bookmark` command) and then entering a textual desciption of the bookmark in the opened menu.
- You can open a searchable list of the bookmarks in the current document by entering :code:`gb` (:code:`goto_bookmark` command).
- You can open a searchable list of all the bookmarks in all documents by entering :code:`gB` (:code:`goto_bookmark_g` command).
- You can delete the closest bookmark to the current location by entering :code:`db`. You can also delete bookmarks directly in the bookmarks list by selecting the bookmark and then pressing the :code:`delete` button on keyboard.
- You can delete the closest bookmark to the current location by entering :code:`db` (:code:`delete_bookmark` command). You can also delete bookmarks directly in the bookmarks list by selecting the bookmark and then pressing the :code:`delete` button on keyboard.

Highlights
^^^^^^^^^^
Expand Down Expand Up @@ -165,7 +168,7 @@ External Search
Synctex
^^^^^^^
- Press :code:`f4` to toggle synctex mode. While in this mode, right clicking on any text opens the corresponding :code:`tex` file in the appropriate location.
- Press :code:`f4` to toggle synctex mode (:code:`toggle_synctex` command). While in this mode, right clicking on any text opens the corresponding :code:`tex` file in the appropriate location.
- You can configure the synctex inverse search command using :code:`inverse_search_command` config in :code:`prefs.config` . Here is an example for VsCode (%1 stands for the name of the file and %2 stands for the line number in the file)::

inverse_search_command "C:\path\to\vscode\Code.exe" -r -g %1:%2
Expand Down Expand Up @@ -202,4 +205,8 @@ Miscellaneous
- You can open the links in PDF files from keyboard by pressing :code:`f` and entering the number next to the desired link. (:code:`open_link` command)
- Toggle fullscreen mode using :code:`f12` (:code:`toggle_fullscreen` command)
- Press :code:`f8` to toggle dark mode. (:code:`toggle_dark_mode` command)
- Press :code:`f5` to toggle presentation mode.
- Press :code:`f5` to toggle presentation mode (:code:`toggle_presentation_mode` command).
- You can use :code:`toggle_horizontal_scroll_lock` command to prevent the document from being scrolled horizontally (can be useful for touchpad users).
- Use :code:`toggle_custom_color` to toggle the custom color scheme configured in :ref:`configuration:Configuration`.
- Use :code:`execute` to open a command line where you can execute shell commands. In this command line :code:`%1` expands to the full path of the current file and :code:`%2` expands to current file name. You can also predefine commands and execute them quickly using :code:`execute_predefined_command`.
- You can export a version of current PDF file with all bookmarks/highlights embedded in it (so it is available to other PDF software) by executing :code:`embed_annotations` command.

0 comments on commit 439385f

Please sign in to comment.