Skip to content

Commit

Permalink
Add entry link override functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Nadler committed Nov 10, 2023
1 parent 1f68735 commit ab2ffe6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
4 changes: 4 additions & 0 deletions NEWS.org
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#+TITLE: Changes

*** 0.2.0 (2023-11-10)

- Add entry link override functionality (=< text >= annotation).

*** 0.1.0 (2023-09-22)

- Initial release
9 changes: 9 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ annotation tag (=ann=) will be added or removed automatically.
Most org-mode formatting will be exported properly, but may differ depending on
the export format.

Surrounding annotation text with angle brackets =< text >= allows you to
override the original entry link and author(s). Everything outside of the angle
brackets will be ignored. This is handy for adding an arbitrary link that is not
currently in your feed list. The entry tags remain unchanged so you can decide
which group(s) the entry should be in. A link override example would typically
look like this:

<[[http://link_url][Link Name]] (Author Name) =Interesting stuff.=>

The following key combinations are used to exit the annotation buffer:

| Keys | Action | Notes |
Expand Down
21 changes: 12 additions & 9 deletions elfeed-curate.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Copyright (C) 2023 Robert Nadler <[email protected]>

;; Author: Robert Nadler <[email protected]>
;; Version: 0.1.0
;; Version: 0.2.0
;; Package-Requires: ((emacs "25.1") (elfeed "3.4.1"))
;; Keywords: news
;; URL: https://github.com/rnadler/elfeed-curate
Expand Down Expand Up @@ -283,14 +283,17 @@ Add a hook to either `elfeed-tag-hooks` or `elfeed-untag-hooks`"
(authors-str (if (= (length author-list) 0) "" (concat " (" author-list ")")))
(other-groups (elfeed-curate-concat-other-groups entry group))
(groups-str (if (= (length other-groups) 0) "" (concat " **[" other-groups "]**"))))
(insert (format "- [[%s][%s]]%s%s\n"
(elfeed-entry-link entry)
(elfeed-entry-title entry)
authors-str groups-str))
(when (> (length annotation) 0)
; Try to keep annotation content under the entry link.
(insert (format " %s\n"
(replace-regexp-in-string "\n" "\n " annotation))))))
(if (string-match "<\\(.*\\)>" annotation)
(insert (format "- %s%s\n" (match-string 1 annotation) groups-str))
(progn
(insert (format "- [[%s][%s]]%s%s\n"
(elfeed-entry-link entry)
(elfeed-entry-title entry)
authors-str groups-str))
(when (> (length annotation) 0)
; Try to keep annotation content under the entry link.
(insert (format " %s\n"
(replace-regexp-in-string "\n" "\n " annotation))))))))

(defun elfeed-curate-tag-to-group-name (tag)
"Convert TAG to a human readable title string.
Expand Down

0 comments on commit ab2ffe6

Please sign in to comment.