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

Suppress warnings for unknown MIME types? #811

Open
arafune opened this issue Aug 18, 2024 · 3 comments
Open

Suppress warnings for unknown MIME types? #811

arafune opened this issue Aug 18, 2024 · 3 comments

Comments

@arafune
Copy link

arafune commented Aug 18, 2024

I use nbsphinx to build pdf file from the ipynb that uses "holoviews".

When I run the cell on the web browser no problem happens. And the logo icons of holoviews (https://holoviews.org) and bokeh (https://bokeh.org) like below.

スクリーンショット 2024-08-18 17 00 19

On the other hand, in the pdf file these icons don't appear. Instead, the warning message appears as follows.

スクリーンショット 2024-08-18 17 02 10

My request is to create a function to suppress this message.

If such feature has been already introduced, let me know the way.

Bests,

@mgeier
Copy link
Member

mgeier commented Aug 18, 2024

Such an option does not exist yet, but it should not be too hard to add.
This is where the message is generated:

{% else %}
.. nbwarning:: Data type cannot be displayed: {{ datatype }}

A new Jinja variable could be added and checked with elif instead of else.

@arafune
Copy link
Author

arafune commented Aug 19, 2024

Thank you for your comment. I'm glad to hear that the implementation process won't be too difficult.

I look forward to seeing it implemented soon.

@mgeier
Copy link
Member

mgeier commented Aug 24, 2024

I look forward to seeing it implemented soon.

I'm not planning to implement that.

If you need that feature, the quickest way is probably to implement it yourself. I'm happy to help if you encounter any problems.

But now that I'm looking at it again, I'm wondering if there isn't a way to fix this from the holoviews/bokeh side?

They could add a text/plain MIME type to the output of their icons, containing a message like "plotting not supported" or something. This way, nbsphinx wouldn't create a warning message.

@mgeier mgeier changed the title Suppress warning Suppress warnings for unknown MIME types? Sep 14, 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