Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a _repr_md_ feature? #80

Open
renecotyfanboy opened this issue Oct 21, 2023 · 2 comments
Open

Add a _repr_md_ feature? #80

renecotyfanboy opened this issue Oct 21, 2023 · 2 comments

Comments

@renecotyfanboy
Copy link

Hi, I would be really interested in adding a functionality that would parse a python block output directly as Markdown. How could I start doing this ?

@smarie
Copy link
Owner

smarie commented Nov 23, 2023

Hello @renecotyfanboy , thanks a lot for this suggestion !

I guess that you are referring to doing something similar to what is provided with _repr_html_ in this example https://smarie.github.io/mkdocs-gallery/generated/gallery/plot_3_capture_repr/

If I am not mistaken, you just need to do three things:

  • in _complete_gallery_conf : add _repr_md_ to "supported_reprs"
  • add _repr_md_ to capture_repr default value in DEFAULT_GALLERY_CONF . It should be second in order (after repr_html and before repr)
  • complete/improve the gallery example 3 , for example by defining a dummy class with _repr_md_ and creating an instance, showing that md is correctly displayed. This example could be done just after the statsmodel example, or just before the matplotlib output section https://smarie.github.io/mkdocs-gallery/generated/gallery/plot_3_capture_repr/#matplotlib-output

In the PR, please also add a changelog section item..

@renecotyfanboy renecotyfanboy closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2024
@smarie
Copy link
Owner

smarie commented Sep 16, 2024

Thanks @renecotyfanboy for taking the time to explicitly disengage from this past idea.
However let me reopen, just to keep track of pending ideas - just in case other community members might be interested in taking a look. Once again thanks a lot !

@smarie smarie reopened this Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants