Skip to content
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

poc: format event html descriptions #1283

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tcuthbert
Copy link
Contributor

@tcuthbert tcuthbert commented Jun 29, 2023

HTML event descriptions are difficult to read, especially when originating from marketing or tech firms.

This PoC proposes transforming event description text through a filter that strips the tag soup and formats text for easier reading on a console displays.

An alternative to my PR would be for users to configure their own formatters, and have subprocess pipe the event descriptions into the process. For example, the user could configure ~/.config/khal/config like so:

[view]
event_description_formatter = pandoc -f html -t plain

To my knowledge there's no way of knowing if an event description is going to be html, so another feature goal could be to have some kind of heuristics and only format if a number of html tags are detected.

This PoC is something I hacked together in an afternoon; as per your suggestion, I didn't want to burn too much time on it in case you reject the feature proposal. Thank you for all the work on khal, I'd love to contribute back as its worked wonders for my smooth ADHD brain.

@geier
Copy link
Member

geier commented Jul 3, 2023

Hi @tcuthbert, I agree that does sound useful!

I'm wondering if this would be a good fit for a plugin (see #1258 and #1279), mainly because I would like to see how that would work and because it seems to be rather well suited (I would guess this could be achieved with overriding Event.description). If it works well and other people find it useful as well, we could then integrate it into khal.

Would this be something you would be interested in?

@tcuthbert
Copy link
Contributor Author

Hi @tcuthbert, I agree that does sound useful!

I'm wondering if this would be a good fit for a plugin (see #1258 and #1279), mainly because I would like to see how that would work and because it seems to be rather well suited (I would guess this could be achieved with overriding Event.description). If it works well and other people find it useful as well, we could then integrate it into khal.

Would this be something you would be interested in?

Yes! I'll take a look at plugins over the next few weeks.

@tcuthbert
Copy link
Contributor Author

Hi @tcuthbert, I agree that does sound useful!
I'm wondering if this would be a good fit for a plugin (see #1258 and #1279), mainly because I would like to see how that would work and because it seems to be rather well suited (I would guess this could be achieved with overriding Event.description). If it works well and other people find it useful as well, we could then integrate it into khal.
Would this be something you would be interested in?

Yes! I'll take a look at plugins over the next few weeks.

Tracking my plugin progress here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants