sioyek-python-extensions
sioyek-python-extensions copied to clipboard
I can't figure out how to use these addons?
Can I get a document?
There is some documentation in the readme. You need to first install it using pip:
python -m pip install sioyek
and then add the configuration corresponding to the addon you want to use to your prefs_user.config. For example if you want to use paper_downloader, add this:
new_command _download_paper python -m sioyek.paper_downloader download "%{sioyek_path}" "%{paper_name}"
control_click_command _download_paper
To your config file.
There is some documentation in the readme. You need to first install it using pip:
python -m pip install sioyekand then add the configuration corresponding to the addon you want to use to your
prefs_user.config. For example if you want to usepaper_downloader, add this:new_command _download_paper python -m sioyek.paper_downloader download "%{sioyek_path}" "%{paper_name}" control_click_command _download_paperTo your config file.
Thank you for your reply. I follow the steps, but it doesn't work. Maybe it is because of my OS.
And can you add your keyboard shortcut in your video? i don't know what you did.
What OS are you using. You can always try to run these commands from command line, for example:
python -m sioyek.paper_downloader download "%{sioyek_path}" "%{paper_name}"
(after replacing %{sioyek_path} and %{paper_name} with the correct values). And see if there are any errors. You can bind them to shortcuts the same way you bind normal keys. For example something like this in your keys_user.config:
_download_paper <C-d>
My system is MacOS 13.0 (22A380).
python -m sioyek.dual_panelify "%{sioyek_path}" "%{file_path}" "%{command_text}"
python -m sioyek.dual_panelify "sioyek" "%{paper_name}" "%{command_text}"
python -m sioyek.dual_panelify "/Applications/sioyek.app" "%{paper_name}" "%{command_text}"
python -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "%{paper_name}" "%{command_text}"
python -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/xxx/Desktop/main.pdf" "%{command_text}"
python -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/xxx/Desktop/main.pdf" "%{command_text}"
I tried all these command and nothing happened. Is there anything I need to modify here?
When you run this manually in command line:
python -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/xxx/Desktop/main.pdf" ""
do you get an error?
When you run this manually in command line:
python -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/xxx/Desktop/main.pdf" ""do you get an error?
Sorry i got it wrong earlier what you meant by the command line. I opened Sioyek and pressed :, typed python command into it.
And It may get something wrong with [email protected](brew version) or armMac or dependencies. I have to back to [email protected] to reinstall pip-sioyek. It doesn't work yesterday on my pc, but it works today. I think maybe some packages were fixed. (PS: these pkgs wew got wrong: numpy swig? metadata wheel pypdf? ,etc. )
Thank you so much for helping me!
Closed to early.
It doesn't work in Sioyek.
# comand line
python3 -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/x/Desktop/main.pdf" ""
# it works
But in Sioyek , I input _dual_panelify2 & _dual_panelify .nothing happened.
# put in pref_user.config
new_command _dual_panelify python3 -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "%{file_path}" "%{command_text}"
new_command _dual_panelify2 python3 -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/kangjiayin/Desktop/main.pdf" ""
I borrowed one of my friends' mac machine and I have found that if you open sioyek using this command:
open /Applications/sioyek.app
it works but when you open it using the GUI it doesn't work.
I am not very familiar with MacOS and how it works so I am not entirely sure what the issue is.
I borrowed one of my friends' mac machine and I have found that if you open sioyek using this command:
open /Applications/sioyek.appit works but when you open it using the GUI it doesn't work.
I am not very familiar with MacOS and how it works so I am not entirely sure what the issue is.
I have the same issue here. Only using the command line open /Applications/sioyek.app can enable the extension.
Meanwhile, I found when I embed_annotations, I have the following issue---some highlights show up---which I did not applied.
Meanwhile, I found when I embed_annotations, I have the following issue---some highlights show up---which I did not applied.
Should be fixed in the latest version of sioyek python package.
I met the same problem in windows10, I can run the command python -m sioyek.translate "%{sioyek_path}" "%{selected_text}" on windows terminal and got the expect result, but it got nothing by using execute in sioyek. My version is python37 and sioyek Release v2.0.0. I open it by clicking "sioyek.exe".
By the way, I test the execute funtion in sioyek. It's ok in my pc, but can't run the above command. I guess there might be something wrong in python module ".sioyek"
What exactly is your configuration?
What exactly is your configuration?
which configuration? the python script or sioyek config?
Both.
I try again. I found two problems:
- If I use
python -m sioyek.translate, I fail. But if I usepython C:\the path\translate.py, it works in execute in sioyek. Both command can run successfully in windows terminal. - If I import some modules like
import translators.server as tss, it will fail. But I can run it successfully in windows terminal. The "fail" I mean is that I run the command in execute in sioyek, but got nothing. I didn't change the sioyek config, and the version is 2.0.0(not protable) the python script is:
import sys
import os
# from googletrans import Translator # I don't want to use it
import translators.server as tss #https://github.com/UlionTse/translators
from .sioyek import Sioyek
if __name__ == '__main__':
sioyek_path = 'D:\\Downloads\\sioyek-release-windows\\sioyek.exe'
text = sys.argv[2]
sioyek = Sioyek(sioyek_path)
sioyek.set_status_string(tss.baidu(text, to_language='zh'))
Do you have multiple python versions?
yes, I have python3.7,python3.9 and pypy3.9, but the default is python3.7 (I type python -V in windows terminal) , and I am sure about that the module was installed at python37.
Maybe sioyek is using another python version? You could specify the exact path to your python executable in prefs_user.config instead of just using python.
Thanks for you replys, now I use "C:\ProgramFiles\Python37\python.exe" and the problems are solven.
I borrowed one of my friends' mac machine and I have found that if you open sioyek using this command:
open /Applications/sioyek.appit works but when you open it using the GUI it doesn't work.
I am not very familiar with MacOS and how it works so I am not entirely sure what the issue is.
I borrowed one of my friends' mac machine and I have found that if you open sioyek using this command:
open /Applications/sioyek.appit works but when you open it using the GUI it doesn't work.
I am not very familiar with MacOS and how it works so I am not entirely sure what the issue is.
Try the absolute path to the python executable
new_command _dual_panelify /opt/anaconda3/bin/python -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "%{file_path}" "%{command_text}"