Hello, Yesterday, I came up with a way to generate the HTML details disclosure fairly easily using Org Special Blocks. I implemented that in ox-hugo. But I believe the same would be useful for ox-html too. Here's the relevant code snippet: ((string= block-type "details") ;; Recognize Org Special blocks like: ;; #+begin_details ;; summary. This will be wrapped in and ;; --- ;; details ;; #+end_details (let* ((is-open (member "open" (org-element-property :attr_html special-block))) (str1 (org-blackfriday-special-block special-block contents nil)) ;; Insert a new-line before the closing tag ;; for correct Markdown parsing for cases when the ;; Special Block content ends a code block. Without this ;; inserted newline, the Markdown converted content will ;; look like below, and Blackfriday won't parse it ;; correctly. ;; ```emacs-lisp ;; (message "a code block") ;; ``` ;; A closing

tag is also added.. the opening

;; tag is later added in the `str2' var if summary is ;; present, else in `str3' var. (str1 (replace-regexp-in-string "\\'" "\n

\\&" str1)) ;; Detect the summary divider special string "---". It ;; must begin at the beginning of a line. Also ensure to ;; replace only the first match, if any. ;; Also add the opening

tag with "details" class ;; so that just as CSS rules can be set for summary ;; ("details summary"), they can be set for the details ;; portion following the

too, using "details ;; .details". (str2 (replace-regexp-in-string "^\\(---\\)\n\\(.\\|\n\\)*\\'" "

" str1 nil nil 1)) (has-summary (not (string= str1 str2))) str3) ;; (message "[DBG details/summary]: is-open:%S `%s' `%s'" is-open str1 str2) (setq str3 (if has-summary (replace-regexp-in-string "\\`

" "\\&" str2) (replace-regexp-in-string "\\`
" "\\&

" str2))) (if is-open (replace-regexp-in-string "\\`\\(" "\\1 open>" str3) str3))) I used "---" as the summary/details divider so that even if someone exports that Org document to HTML without that support in ox-html, it exports as Summary — Details. See this for examples: https://ox-hugo.scripter.co/doc/details-and-summary/ Here is the full org-hugo-special-block: https://github.com/kaushalmodi/ox-hugo/blob/14533c96195c90e417fcbde9d938650e83a39125/ox-hugo.el#L2239-L2363 If this feature is approved for addition to ox-html, I can make a formal patch where instead of looking for "---", I look for the appropriate string based on the value of (plist-get info :with-special-strings). Thanks! Kaushal -- Kaushal Modi