![]() Registered Member ![]()
|
Hi,
I'd like to execute a bash shell command on shortcut. The command is going to take three parameters: (pdf) file name, current line number (in editor window), (edited) file name. The exact command will be something like this:
Let me explain (not quite on topic). Where are developers' guides or something like that on KDE apps? This is not the first time I get frustrated. I looked up Kate/KatePart docs, of course. You can learn from them that scripting language is JavaScript, and that's pretty much that. This Okular command line solution is not documented at all. Inventive googling reluctantly brings it up, word-of-mouth like. Is it really FOSS 'undocumented function'? Config file formats also go undocumented, you have to guess Esc or Ctrl keys syntax, for instance. What is the right KDE way to go about such should-be-easy things? |
![]() Global Moderator ![]()
|
"I want to write a script which opens a pdf at a specific place depending on the current cursor position in my text editor when I press a shortcut" is a strange thing to classify as "should-be-easy" ![]() Part of it is in okular --help; not in much detail, that's true. I don't know how you would find out about the # stuff; I'm not even sure if that is a pdf thing or an okular thing. If you need such a specific feature, my approach would be to a) read the source, or b) ask on a mailing list or IRC whether it's possible. The kate scripting API reference is e.g. here: https://docs.kde.org/trunk5/en/applicat ... pting.html Greetings, Sven
I'm working on the KDevelop IDE.
|
![]() Registered Member ![]()
|
The resulting script will take well inside ten lines of JavaScript code, curly braces included. Should be easy, IMHO.
This is a good example of what I am ranting about. Not your fault, sorry. |
![]() Global Moderator ![]()
|
I'm not sure if that is a good measure for complexity ![]()
Hm, but why? Is that such a bad place for it to be? Or, let's turn it around: where do we put it so you'd say it is easy to find? Best, Sven
I'm working on the KDevelop IDE.
|
![]() Registered Member ![]()
|
True, the official docs are easy enough to find. Unfortunately, they are very sparse, to put it mildly. This is consistent throughout the KDE project. The okular --unique 'file.pdf#src:linenumber file.tex' thing is nowhere to be found, just certain private messages, hard to google. Where did they find it? Not in the docs. |
![]() Global Moderator ![]()
|
I feel this is consistent across the world; the more in-depth you go, the less docs you find. I would guess for the #-trick that either a developer answered, or somebody read the source code. Frankly, I think expecting this kind of niche feature to be neatly documented in some beginner-friendly tutorial is just unrealistic; nobody has the time to write and especially maintain that resource.
Kate scripting is a bit different, what do you think the documentation lacks? Contributions are cerainly welcome. We also have the KDE userbase wiki, which is a wiki, and you are very welcome to document your own findings there if you think they would be useful for others.
I'm working on the KDevelop IDE.
|
Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]