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

struggling with images #437

Closed
parmentelat opened this issue Apr 17, 2020 · 4 comments
Closed

struggling with images #437

parmentelat opened this issue Apr 17, 2020 · 4 comments

Comments

@parmentelat
Copy link

as per your request in chrisjsewell/ipypublish#133

I have given a try to nbsphinx to convert towards readthedocs.io a set of slideshow notebooks
those slides contain images that come in a variety of ways

  • as often as possible, using pure markdown ![](pictures/image.png)
  • sometimes as a html tag when I need to resize <img src="pictures/image.png" height="400px">
  • and even sometimes as more elaborate html tags, when I want to have them float on the right or left hand side of the page; this last usage is admittedly quite rare

in any case it looks like all the instances where I used the 2nd approach just vanish from the final html result after I run sphinx; this is a pain because there are a lot of the pictures, and I don't feel comfy with messing with them all, b/c because it would jeopardize the slideshow rendering, which is its first, and until now foremost, purpose :)

@mgeier
Copy link
Member

mgeier commented Apr 17, 2020

Thanks for the report!

It is known behavior that <img> tags don't survive the conversion (and their src files are not copied to the HTML directory).

Support for <img> tags has been requested quite a few times already:

#52
#284
#321

I've said in #284 (comment) that I'm not planning to work on this, but probably I should finally implement it (since nobody else seems to volunteer)?

@mgeier
Copy link
Member

mgeier commented Apr 18, 2020

OK, I've given it a try ...

Sadly, I couldn't make the align attribute work, but specifying the size should work with #438.

@mgeier
Copy link
Member

mgeier commented May 8, 2020

I've just made a new nbsphinx release (0.7.0) which includes the <img> parsing feature.

As mentioned above, the align attribute is not supported, but you can assign a class and then handle the alignment with custom CSS.

@parmentelat Does that work for you?

@mgeier
Copy link
Member

mgeier commented Jul 10, 2020

I guess this can be closed.

@mgeier mgeier closed this as completed Jul 10, 2020
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