Thanks a lot. This is very close to what I am looking for, and saves a lot of my time. I am grateful to all the help I received from this mailing list.

It is a lot of fun subscribing to this list.

Regards

Ziping

On Jan 21, 2022, at 11:46 AM, Max Nikulin <manikulin_at_gmail_com_fcq2724cv3y0tc_re5x9491@icloud.com> wrote:

On 21/01/2022 19:23, Juan Manuel MacĂ­as wrote:
ZIPING CHEN writes:
I may have many things like this in the middle of the file.
************************** a new heading.

I wish to turn all layers of
headings in org file into collapsable headline to html.

Does anybody know a way I can accomplish this?
I think that you need to add javascript and enclose the collapsible
content in a div.

Have a look at info "(org) JavaScript support" https://orgmode.org/manual/JavaScript-support.html (I have not tried that folding view).

HTML has <details><summary>header</summary>body</details> elements that works without JS, but it will require custom exporter.

You should ensure that deep headings can not be recognized as org inline tasks. Check ox-html, it may has limit on number of levels that are exported as headings with switching to lists for deeper structures.