Post AZUnuHSWXOVFy4VYA4 by wervice@fosstodon.org
 (DIR) More posts by wervice@fosstodon.org
 (DIR) Post #AZUnE3r8iscjcHtF3o by fox@emacs.ch
       2023-09-06T16:19:13Z
       
       0 likes, 1 repeats
       
       Just discover the HTML tag "<details>". It let you write a content which will be hidden by the browser into a widget. You can expand the widget by clicking on it, revealing the content.Very useful if you write a question and want to provide the answer.More info: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details#HTML
       
 (DIR) Post #AZUnkiBKKROfx0twWm by fox@emacs.ch
       2023-09-06T16:25:01Z
       
       0 likes, 1 repeats
       
       And here is how to use it with Org-mode.First, you need to define the doctype of your Org-mode document to html5 and enable "html5-fancy". For that, simply add this at the top of your Org-mode document:#+HTML_DOCTYPE: html5#+OPTIONS: html5-fancy:tThen, write the content you want to hide into this kind of block:#+begin_detailsWrite content to be hidden wrote here#+end_detailsAnd voilà, you can export your Org-mode document into HTML and have the content you want hidden into a widget.#OrgMode #Emacs
       
 (DIR) Post #AZUnuHSWXOVFy4VYA4 by wervice@fosstodon.org
       2023-09-06T16:26:51Z
       
       0 likes, 0 repeats
       
       @fox Very cool, this makes FAQs,... way easier to create. Thank you.
       
 (DIR) Post #AZUt335Vq1WFm1kFE0 by fox@emacs.ch
       2023-09-06T17:24:27Z
       
       0 likes, 1 repeats
       
       And if you want to add the "<summary>" tag into the "<details>" tag, you can do like it:#+begin_details#+begin_summary #+HTML: Reply to question 4#+end_summaryHere is the solution to question 4: …#+end_detailsThe "#+HTML:" is to avoid wrapping the summary text into a "<p>" tag
       
 (DIR) Post #AZVM9Ig9gIroXKDXJg by gmoretti@mastodon.social
       2023-09-06T22:50:31Z
       
       0 likes, 0 repeats
       
       @fox Thanks for that - I'd only recently discovered the collapsible <detail> element, and hadn't occurred to me to use it as you describe. Now to add that to my org-roam collection ..
       
 (DIR) Post #AZVYmpTOsySKzQrnOK by sachac@emacs.ch
       2023-09-07T01:12:01Z
       
       0 likes, 0 repeats
       
       @fox I have some code that lets me add `:summary` to my `#begin_src ...` blocks so that they're collapsed: https://sachachua.com/blog/2023/01/adding-a-custom-header-argument-to-org-mode-source-blocks-and-using-that-argument-during-export/
       
 (DIR) Post #AZWyG9vUc2Pspm35pA by fox@emacs.ch
       2023-09-07T17:32:06Z
       
       0 likes, 0 repeats
       
       @sachac That very nice. Thank you. I will add it to my Emacs config. :blobcathearthug:​