Hi Kaushal,
It seems like a good idea. My two comments are:
- Remember that ox-html can export to HTML4, so the code would need to
detect that case and have a sensible fallback
Yes, I think that would need to be handle just as ox-html does now.. use div tags instead of details and summary tags.
- The approach of looking for “magic” strings in the contents seems
hackish. What if the summary was treated as a caption?
I also feel like that's a hack, but seems quite robust and functional at least in my tests. The main reason to make summary part of details was to no impose a one-paragraph limit on summaries.
#+caption: Open for details
#+begin_details
Many details here.
#+end_details
(Admittedly, the mismatch between “caption” and “summary” is not ideal,
but caption is the only suitable keyword that the syntax gives us...).
I agree. caption doesn't go well with details.. looks like making a stew out of whatever's in the fridge. Hope that bad metaphor makes sense :)
Another idea would be:
#+begin_details
#+summary: Open for details.
Many details here.
#+end_details
HTML allows multi-paragraph summaries.. (see my test link above). Expanding on your idea.. what if we had another Special block with name summary?
#+begin_details
#+begin_summary
Open for details
More summary.
#+end_summary
Many details here.
#+end_details
It doesn't look as pretty as using the magic string "---", but it should work. But still not sure..
Just food for thought...
I appreciate that.