koreader / koreader

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
http://koreader.rocks/
GNU Affero General Public License v3.0
16.79k stars 1.26k forks source link

FR: Support collapsible html <details> element #12621

Open anaxonda opened 4 weeks ago

anaxonda commented 4 weeks ago

Does your feature request involve difficulty completing a task? Please describe. I download comments pages as html to read them on an ereader with koreader. I have a script that scrapes the comments and puts them into a <details> element. On a regular web browser it is collapsible, so I can hide any comments, and those nested below it if I'm not interested in them.

Here's an example comment that is foldable:

<details open>
<summary><b>comment_author</b>:</summary>
<p>Comment text</p>
<div style="margin-left:20px;">

Describe the solution you'd like Ability to collapse comments in the details block.

Describe alternatives you've considered If there's another way to have folding/collapsible elements I would be curious to know.

Frenzie commented 4 weeks ago

Collapsible isn't really possible (without rerendering the whole document) but a popup might be doable. Pinging @poire-z for thoughts.

poire-z commented 4 weeks ago

We won't have any collapsing handled by crengine/UI. Even a popup (transferring data from crengine to our frontend UI) is a lot of work for such a niche use case. So, no, we're not a dynamic web browser and won't be.

Only idea I got, but it's all or nothing, is toggling a style tweak to change the details style to show/hide its content - but it's all of them or none.