termynal / termynal.py

Python markdown terminal. Built for mkdocs
https://termynal.github.io/termynal.py/
MIT License
85 stars 8 forks source link

Support within lists, admonitions, and content tabs #18

Open CollinHeist opened 8 months ago

CollinHeist commented 8 months ago

Hello, love the project! Thanks for your hard work.

I think it would be great if the terminals could be embedded below lists, and within admonitions / content tabs.

Thanks!

daxartio commented 8 months ago

Hi!

I thought about it. I wanted to do interoperability with mkdocs-material.

daxartio commented 8 months ago

Have you wanted to see the result like this?

image
CollinHeist commented 8 months ago

As far as raw HTML, yes that was what I was envisioning. After rendering, like this:

image

After briefly looking at the code, I think the termynal regex would need to be modified to handle arbitrary indentation (that takes care of lists, admonitions, and tabs), as it currently only looks for left-aligned code blocks (no \s*)

eshaben commented 7 months ago

Yeah, I am running into the same problem. I have a numbered list that I would like to show the terminal output for each step of the way, but since the terminal doesn't render when indented, I can't use it 😔

daxartio commented 5 months ago

Since version 0.12, the plugin supports content tabs