Compare commits
5 commits
99c5ca9fb2
...
d3b5bdcc46
Author | SHA1 | Date | |
---|---|---|---|
d3b5bdcc46 | |||
9156f202f3 | |||
0739882bfa | |||
2a68a3850c | |||
334b8b6a05 |
4 changed files with 50 additions and 2 deletions
|
@ -77,7 +77,8 @@ The =deploy= target first makes sure that =build= has been executed at least onc
|
||||||
deploy: ## Deploy the site to live
|
deploy: ## Deploy the site to live
|
||||||
@[[ -e public/index.html ]] || (echo "Run 'make build' before deploy" && exit 1)
|
@[[ -e public/index.html ]] || (echo "Run 'make build' before deploy" && exit 1)
|
||||||
rsync --verbose --checksum --recursive --delete \
|
rsync --verbose --checksum --recursive --delete \
|
||||||
--exclude '*~' --exclude '.emacs-local' --delete-excluded \
|
--exclude '*~' --exclude '.emacs-local' --exclude 'posts/' \
|
||||||
|
--delete-excluded \
|
||||||
public/ ryuslash.org:ryuslash-next/
|
public/ ryuslash.org:ryuslash-next/
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
45
posts/20231107-til-i-can-use-elfeed-search-face-alist.org
Normal file
45
posts/20231107-til-i-can-use-elfeed-search-face-alist.org
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
#+title: TIL: I can use elfeed-search-face-alist to highlight certain headlines in Elfeed
|
||||||
|
#+tags: emacs, elfeed, til
|
||||||
|
#+comments: on
|
||||||
|
#+status: publish
|
||||||
|
#+DATE: Thu, 07 Dec 2023 22:45:51 GMT
|
||||||
|
#+UPDATE_URL: /admin/modify-post/2023%252f12%252f07%252ftil-i-can-use-elfeed-search-face-alist-to-highlight-certain-headlines-in-elfeed
|
||||||
|
|
||||||
|
I rediscovered that I can use =elfeed-search-face-alist= to customize how headlines are displayed in Elfeed. I had read it before [[https://nullprogram.com/blog/2015/12/03/#custom-entry-colors][on Chris Wellons' blog]], but I didn't have a use for it then.
|
||||||
|
|
||||||
|
With =elfeed-search-face-alist= I can define a face to be used for an article with a specific tag. I added the [[https://blabbermouth.net/][Blabbermouth]] RSS feed to my feeds.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq elfeed-feeds '(("https://blabbermouth.net/feed" music)))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
And created 2 taggers. One tags reviews, because those always have =/reviews/= in the url. The other has a list of bands that I'm especially interested in.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defvar oni-elfeed-blabbermouth-review-tagger
|
||||||
|
(elfeed-make-tagger :feed-url (rx "blabbermouth.net")
|
||||||
|
:entry-link (rx "/reviews/")
|
||||||
|
:add 'review)
|
||||||
|
"Tagger that marks any reviews from Blabbermouth.")
|
||||||
|
|
||||||
|
(defvar oni-elfeed-blabbermouth-favourite-tagger
|
||||||
|
(elfeed-make-tagger :feed-url (rx "blabbermouth.net")
|
||||||
|
:entry-title (rx (or "SLIPKNOT"
|
||||||
|
(seq "DREAM" whitespace "THEATER")
|
||||||
|
;; And so on...
|
||||||
|
))
|
||||||
|
:add 'favourite)
|
||||||
|
"Tagger that highlights specific bands from Blabbermouth.")
|
||||||
|
|
||||||
|
(add-hook 'elfeed-new-entry-hook oni-elfeed-blabbermouth-favourite-tagger)
|
||||||
|
(add-hook 'elfeed-new-entry-hook oni-elfeed-blabbermouth-review-tagger)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
And then I can just set up the feeds:
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(add-to-list 'elfeed-search-face-alist '(review :slant italic) t)
|
||||||
|
(add-to-list 'elfeed-search-face-alist '(favourite :foreground "#f17272") t)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
As long as the face definitions don't conflict a headline's face would be the combination of all that apply. For example, by default unread headlines are bold, so unread favourite messages would be bold and somewhat reddish.
|
|
@ -109,7 +109,7 @@ pre {
|
||||||
|
|
||||||
p { margin: 0; }
|
p { margin: 0; }
|
||||||
|
|
||||||
p + p { margin: 1rem 0; }
|
p + p { margin: 1rem 0 0 0; }
|
||||||
|
|
||||||
.footdef {
|
.footdef {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
pre.src {
|
pre.src {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
padding: 0.5rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-wrapper {
|
.content-wrapper {
|
||||||
|
|
Loading…
Reference in a new issue