github / markup

Determines which markup library to use to render a content file (e.g. README) on GitHub
MIT License
5.87k stars 3.39k forks source link

Org-mode collapsible contents not supported #1451

Closed ireina7 closed 2 years ago

ireina7 commented 3 years ago

In normal markdown files, I can use <details> and <summary> to implement collapsible contents, e.g.

Click me

hidden content

However, this function seems to be not supported in org-mode, please add this function which is very useful.

agzam commented 2 years ago

@ireina7 it looks like there are two ways to achieve this. Note that I have performed only limited testing by pushing a single .org file to GitHub. I don't know yet if this works in issues, PRs, etc.

You can inline it like this:

#+HTML: <details> <summary> Click me</summary> and this part should be collapsed </details>

But there's no use for it since everything has to be on the same line. However, this:

#+begin_html
  <details>
    <summary>
    Click me
    </summary>
    And this stuff will be collapsed.

    Nullam eu ante vel est convallis dignissim. Fusce suscipit, wisi nec facilisis
    facilisis, est dui fermentum leo, quis tempor ligula erat quis odio. Nunc porta
    vulputate tellus. Nunc rutrum turpis sed pede. Sed bibendum. Aliquam posuere. Nunc
    aliquet, augue nec adipiscing interdum, lacus tellus malesuada massa, quis varius mi
    purus non odio. Pellentesque condimentum, magna ut suscipit hendrerit, ipsum augue
    ornare nulla, non luctus diam neque sit amet urna. Curabitur vulputate vestibulum
    lorem. Fusce sagittis, libero non molestie mollis, magna orci ultrices dolor, at
    vulputate neque nulla lacinia eros. Sed id ligula quis est convallis tempor. Curabitur
    lacinia pulvinar nibh. Nam a sapien.

  </details>
#+end_html

For some mysterious reason appears to work

kisaragi-hiu commented 2 years ago

See Org Mode manual node Quoting HTML tags. "<" and ">" are escaped by default so that they are not interpreted as tags.

There are three ways to write HTML tags in Org:

ireina7 commented 2 years ago

Thank you everyone.