-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browsing reddit page from URL #37
Comments
I don't think it'd be a hard thing to add better facilities around - for example, just appending a
This will produce the md4rd buffer of just that conversation. A neat addition might be a small function that takes a reddit URL and appends the .json + calls that function (maybe eww has some type of hook where you could bypass the eww rendering/page open event, and instead run this new idea) |
I believe I have something like this working: (defun md4rd-open-post (url &rest _args)
(md4rd--fetch-comments (concat (string-replace "www" "old" url) ".json")))
(push (cons
(rx line-start "http" (zero-or-one "s") "://www.reddit.com/" (one-or-more anychar))
#'md4rd-open-post)
browse-url-handlers)) This is sufficient to cause reddit posts to open in md4rd when I hit Note that |
Hi folks. Great, @treed, thanks for that code snippet. However, adding a hook to (use-package eww
:preface
(defvar apt-reddit-url-regex
(rx line-start "http" (zero-or-one "s") "://www.reddit.com/" (one-or-more anychar)))
(defun apt-open-reddit-if-url-matches ()
(when (string-match-p apt-reddit-url-regex (or (eww-current-url) ""))
(md4rd-open-post (eww-current-url))))
:hook ((eww-after-render-hook . apt-open-reddit-if-url-matches))) |
Awesome, ty for sharing! |
Hi. Given a reddit URL that points to a discussion (such as 1), would it be possible to browse that with
md4rd
?I haven't found any command for this, but I might be missing something.
Use case: I sometimes find reddit threads in Google results in
eww
. Their rendering is a bit confusing, though. So I'd like to use a specialized packaged for browsing threads.The text was updated successfully, but these errors were encountered: