0

Markdown has expandable content option to hide and unhide a block of text or a video. This option most often used in README.md that is view through github.

Example from:

<details>
  <summary>Click me</summary>
  
  ### Heading
  1. Foo
  2. Bar
     * Baz
     * Qux

  ### Some Code
  ```js
  function logSomething(something) {
    console.log('Something', something);
  }
</details>

enter image description here

When > is clicked it gets expended.


Is it possible to achieve same property on org-mode for the README.org files?

1 Answer 1

1

Org mode has drawers for this; however, they can't contain headings, but lists and source blocks are fine. Use org-insert-drawer (C-c C-x d) to insert one (and TAB to hide and unhide its contents when at their top line):

:Details:
"Heading"
1. Foo
2. Bar
   - Baz
   - Qux

#+begin_src js
function logSomething(something) {
    console.log('Something', something);
  }
#+end_src
:END:

Unfortunately Org drawers are not rendered on Github though: It just strips away the :Details: and :END: part...

2
  • If I notify GitHub related to this can they work around to render in?
    – alper
    Commented Jan 13, 2023 at 10:20
  • They certainly can. You can try to get them to... :)
    – orgtre
    Commented Jan 13, 2023 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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