Data from collapsible section in a Page

If you know the macro ids you can use this REST API.

Another way would be to parse the storage format of the page yourself (e.g. using Jsoup). The storage format of expand macros looks like this:

<ac:structured-macro ac:name="expand">
  <ac:parameter ac:name="title">Expand me...</ac:parameter>
  <ac:rich-text-body>
    <p>This text is hidden until you expand the section.</p>
  </ac:rich-text-body>
</ac:structured-macro>

It may be useful for you to have a look at this question where they are doing something similar (they are searching for macros with the name “dihk-taskassign-macro” instead of “expand”).

1 Like