karthink / elfeed-tube

Youtube integration for Elfeed, the feed reader for Emacs
The Unlicense
258 stars 13 forks source link

Caption style: one caption per line #14

Open qingshuizheng opened 1 year ago

qingshuizheng commented 1 year ago

https://github.com/karthink/elfeed-tube/blob/18d89f19203423b9e2df59a556c1240746903d8f/elfeed-tube.el#L682-L694

Hi @karthink , it is a great package to have!

Could we have an option to enable one caption per line? I find it much more readdable (for me) to use caption one by one instead of putting them together. Maybe something like elfeed-tube-one-caption-per-line, or elfeed-tube-caption-style with options:

I tweak it with `elfeed-tube-one-caption-per-line' as starting point:

(defcustom elfeed-tube-one-caption-per-line nil
  "If non-nil, show one caption per line."
  :group 'elfeed-tube
  :type 'boolean)

And change the quoted code with:

(string-join
 (mapcar (lambda (tx-cons)
           (propertize (cdr tx-cons)
                       'timestamp
                       (car tx-cons)
                       'mouse-face
                       'highlight
                       'help-echo
                       #'elfeed-tube--caption-echo
                       'keymap
                       elfeed-tube-captions-map))
         para)
 (if elfeed-tube-one-caption-per-line
     "\n"
   vspace))

(I believe this "\n" should be put together with `vspace', but this is only a rough demostration. :-))

Result:

Transcript:

[0:00] - [0:30]:
hey guys welcome back today we will be
making banana bread overnight oats let's
get started
[Music]
[Music]
so for this recipe you will need oats
yogurt vanilla almond extract maple
syrup one mashed banana and almond milk
all right guys so I'm gonna start with

[0:30] - [1:00]:
adding oats to the jar first there
really is no correct order for this
because at the end we're just gonna mix
everything up really good so I just
added my oats and then I'm going to add
some almond milk on top
foreign
next I'll add my vanilla yogurt you can
use any flavor vanilla or any flavor
yogurt that you'd like and then I'll add

Additional: maybe add a timestamp before each caption line?

Appreciate that if we could have all this options 😄 Zheng

karthink commented 1 year ago

Could we have an option to enable one caption per line? I find it much more readdable (for me) to use caption one by one instead of putting them together.

@qingshuizheng Instead of defining a bunch of caption styles in elfeed-tube-caption-style, I can turn the display code into a function that can be replaced with a user-defined one. Then you can plug in whatever display style you would like in its place.

How does that sound?

qingshuizheng commented 1 year ago

That’d be perfect. No hurries, do it when you have time. On Feb 22, 2023, 15:42 +0800, karthink @.***>, wrote:

Could we have an option to enable one caption per line? I find it much more readdable (for me) to use caption one by one instead of putting them together. @qingshuizheng Instead of defining a bunch of caption styles in elfeed-tube-caption-style, I can turn the display code into a function that can be replaced with a user-defined one. Then you can plug in whatever display style you would like in its place. How does that sound? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>