Evidlo / remarkable_news

Daily news/comics on your reMarkable's suspend screen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xkcd comic needs Hover text added.

Snowflake6 opened this issue · comments

commented

Getting the xkcd comic seems easy but is there a way to get the mouseover/hover text and adding it as a caption at the bottom of the screen?

Looks like that would require fetching the title attribute for the image HTML element, then rendering it in the whitespace below the fetched image.

I started to write some text to the image... but the font glyphs I'm using are pretty small!

master...fringley:feature/text-label

To be more successful, I think we would need to load in a font file, and then I'm not sure how to have this building for both environments. Comments welcome.

adding a -text flag to the command will add in some static text. For me this is enough (as i just want to add my contact details)... but as the request mentions, it would also be nice to pull through the alt text with another xpath expression.

Perhaps someone can take this further, as I'm still a Go newb.

I updated my branch with the XKCD font which has a CC licence for non-commercial use.

The install script copies this to the root / which I'm pretty sure is not the right place for this - but my knowledge of Go and the filesystem on the rM is limited - so am open to suggestions for a better method of this working in x86 and arm environments.

However, the font is a decent size now! And would nicely match the xkcd comic if the alt text (rather than a static string) is passed in.

#37 solves this by adding titles, subtitles and configurable fonts. With the xkcd ttf file:

image

[Unit]
Description=XKCD

[Service]
ExecStart=/home/root/bin/renews \
    -output /usr/share/remarkable/suspended.png \
    -verbose \
    -cooldown 3600 \
    -url https://xkcd.com \
    -xpath '//div[@id="comic"]/img/@src' \
    -xpath-title '//div[@id="comic"]/img/@alt' \
    -xpath-subtitle '//div[@id="comic"]/img/@title' \
    -title-font-path '/home/root/xkcd.ttf' \
    -subtitle-font-path '/home/root/xkcd.ttf' \
    -mode center \
    -scale 1.75
Restart=always

[Install]
WantedBy=multi-user.target