1

I'd like to create a collapsible block (examples, quotes, codes, ...) when exporting an org file to HTML. Also I'd like to have a way to show the block(button? keystroks?). How can I do this?

Thanks!

  • This would be great, but I don't think it is available at the moment. It would require implementing the show/hide features of orgmode in javascript and adding that to the html exporter. Which should be possible, but I'm not sure how much work it would be. That said, there might be someone who has already done this? – Tyler Oct 16 at 13:45
  • There is Sebastian Rose's org-info.js which I believe is used in Worg - the Org mode wiki. – NickD Oct 16 at 14:06
  • @NickD I know about info.js, but it seems only allow folding headings, not blocks. – stackunderflow Oct 16 at 14:53
  • Yes, blocks did not exist back when it was implemented, but maybe you can enhance it to do that (and maybe send the enhancements to the Org mode list - hint, hint...) – NickD Oct 16 at 15:04
  • @Tyler See my answer for a possible solution. – stackunderflow Oct 19 at 10:11
2

Found a possible solution by using https://alhassy.github.io/org-special-block-extras/#Folded-Details

#+begin_details org
:title: Click to see dummy code
#+begin_src elisp
(message "Dummy code")
#+end_src
#+end_details
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.