Viewing gemini:// links from linkulator #102
No reviewers
Labels
No Label
bug
compatibility
documentation
duplicate
enhancement
future release
help wanted
invalid
non-code
question
refactor
testing
this release
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cmccabe/linkulator2#102
Loading…
Reference in New Issue
No description provided.
Delete Branch "samhunter/linkulator2:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tested on my RCT account.
WIP: browsing for gemini:// linksto Browsing for gemini:// linksBrowsing for gemini:// linksto Viewing gemini:// links from linkulatorhi @samhunter thanks for coming up with this and submitting it
this actually covers part of #69
i'll review this when i get some solid free time, should be in the next day or so
I was actually thinking about moving the if/elif/else into a hash/assoc. array based construct with flexible (if executable handling a protocol is found - add the browser to the hash) number of handlers.
Proof of concept
The "next little step"(tm) perhaps...
I'm not entirely sure what that would mean, like a subclass of dict with methods to add browser entries if they are found on the system?
Overall I actually want to make this a bit simpler, and maybe not have any defaults specified. The checks using
which
could probably be removed and handled if subprocess.call (or subprocess.run) fails?All of this is step 5 or 6 though, I'll start with step 1 for now. Thanks again.
Browser is selected on 'b' from the dictionary, if there's no entry for the URL schema and/or the named executable wasn't found - the program offers opening it with the standard browser.
Where will you find the programs matching the protocols? Under X it's easy - everything can be opened with xdg-open {url}...
I don't like the idea of exception as a regular control mechanism, but well it can be done. You're the boss.
Hi @samhunter,
Looks like this throws a key error when attempting to open an existing configuration file:
Here's an example file:
This looks a bit more complicated than it might seem. We should probably use the config parser's methods and exceptions better, like get or items so that we can handle this using NoSectionHeader instead. This might look like:
With that said, however it might be handled, the user experience from the change should be a good one. Having both browser AND handler in the config file might be confusing, so it might be better to just move to the single setting in one go. Also I'd prefer no defaults set, but importing the existing setting for https/gopher would be ok if it wasn't too complicated.
I guess it's a bit more involved than your original suggestion, sorry about that. If you have some different ideas let me know. We could push this to a feature branch instead of master and work on it there?
Hi @asdf,
In my un-pushed local copy I handle it in a rather simplistic way:
On closing the file is overwritten with:
Having editable defaults makes the system more flexible and adjustable to the specific user needs. If we only could 'plumb' everything ;-)
Oh, I enjoy it. Recently added a (crude, it's merely a PoC thing) telnet:// handler too:
In general I think letting linkulator accept, store and return URLs, and moving resonsibility for the correct interpretation of URLs to the called programs is a reasonable way of keeping the bloat low. Good Unix behaviour too ("Do one thing, well.")
I considered replacing the config.USER.browser either with the value of handler["http"] or env["PAGER"] (with fallback to env["EDITOR"]).
It actually should check the local variables for BROWSER, EDITOR, PAGER.
The standarization in the area didn't go very far (kind of hijacked by xdg-open).
Anything that can help to add it without much fuss and in an efficient way.
I am "eating my own dog food" anyway ;)
[UPDATE]
Removing 'gopher' entry causes
linkulator
to ask about opening gopher:// links with the default browser.$BROWSER
for gopher:// might be tricky:Hi @samhunter,
From this discussion, I've made additional comments on #69 with proposed functionality.
My proposal goes beyond your current pull request, and I don't expect you to take this on and implement as specified. Also, I apologise that this may delay your requested functionality, but I see this change as maybe being backwards incompatible so want to do it all in one go.
If you want to contribute your existing work, or anything in addition, you can change this PR to merge to the branch additional-url-handlers.
Also, feel free to provide any other feedback on my proposal at #69.
Regards,
asdf
Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.