IBM / marked-it-cli

marked-it-cli
MIT License
5 stars 15 forks source link

Twisty/accordion support/implementation in MD #26

Open SteveS-Cpub opened 2 years ago

SteveS-Cpub commented 2 years ago

This is more of a feature request, but could marked-it-cli support putting markdown elements into HTML elements, specifically into <details> tags to create twisties/accordions in our documentation? In concert with #includes, if we embed an includes today, it shows up, but without inherits none of the formatting:

<details>
<summary>Twisty label</summary>
#include "topic.md"
</details>

Currently, adding hardcoded Markdown within these elements doesn't work either (as in the following example, but also including other variants of <p> placement, or even without <p> tags):

<details>
<summary>Twisty label</summary>
<p>

## title

content

</p>
</details>

We're looking to import content into a collapsible view while retaining our MD source.

grant-g commented 2 years ago

I see the problem you describe when I run your example through marked-it V1. However marked-it V2 appears to handle it better, here's the output it gives me:

<html>

<body>
  <details>
    <summary>Twisty label</summary>
    <p>
    </p>
    <h2 id="title">title</h2>
    <p>content</p>
    <p></p>
  </details>
</body>
</html>

So I think you're all set. @SteveS-Cpub can you confirm that the above output is along the lines of what you need, and that you're seeing the problem with marked-it V1 (not V2)?