Ireina
Ireina

Reputation: 386

Is there any way to show collapsible contents in github README.org (org-mode)?

I come from emacs org-mode and I really love using it on github README. The problem is that I found that in markdown github README.md file, one can use:

<details>
    <summary>Title</summary>
    contents
</details>

to show collapsible contents which is very useful in various situations. However, I cannot find how to implement this collapsible function in README.org(org-mode). Can anyone help me?

Upvotes: 2

Views: 347

Answers (2)

iLemming
iLemming

Reputation: 36166

I have commented in the GH issue you've created here: https://github.com/github/markup/issues/1451

Let me repeat that here for posterity:

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

Upvotes: 2

VonC
VonC

Reputation: 1323223

The only mention of collapsed section in fniessen/refcard-org-mode syntax is in the TODO extension

** TODO [#B] Apply GTD methodoloy
   DEADLINE: <2014-12-01 Mon>
   :PROPERTIES:
   :HTML_CONTAINER_CLASS:    hsCollapsed
   :END:

This section will be collapsed when loading the page because the entry has the
value ~hsCollapsed~ for the property ~:HTML_CONTAINER_CLASS:~.

That extension might not be fully supported on GitHub though.

Upvotes: 1

Related Questions