-
Notifications
You must be signed in to change notification settings - Fork 132
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
Support images with raw html syntax #52
Comments
Currently, pandoc is used to convert markdown cells, but in the not-so-near future this will probably be changed, see #36.
How is this handled in |
Also pandoc, so it may well have the same issue. |
Alternatively, However, yet another option would be to convert all raw HTML content (not only I don't know if that would work, and I don't know if that's actually a good idea, either. This way, the images wouldn't show up in LaTeX output. |
Was this resolved? I've taken to using the Jupyter notebook/iPython helpers but importing libraries just to show images in notebooks that are all Markdown is kind of kludgy. Edit: I should have read more carefully. It looks like ![alt] can be used for now but it seems like the sizing information is ignored anyway (#12). |
@actsasgeek No, nothing has changed since then. Do you have any suggestions on how to proceed? |
Mmh, I just ran into this issue again today, so piping in here and pinging @mpacer to see if they have any ideas... I just checked, and running a plain |
A bit more info... At least with current pandoc, it seems that However, in the live notebook, the extra attributes are displayed as text instead of being used (and the text is only used as alt-text, not as a caption). E.g., this:
gives in the live notebook: This makes me wonder: should we instead just support the pandoc-style attributes in the live notebook? I know @mpacer has thought a lot about this, and perhaps @Carreau and @takluyver have also thoughts? note: in the nbsphinx conversion, the alt-text shows up as a caption, which surprised me but sounds actually like a good thing, it certainly would encourage better alt-text usage, I think. This is what it looks like on the HTML output: |
I'm all for consistent support, and would actually also prefer captions, though I don't want us to maintain our own markdown renderer in JS, at least not now :-) If anything let push that for JupyterLab once it has been released and the classic notebook has been sunset. Then we'll have less things to patch. |
I could be wrong but I think that this should work for direct HTML conversion, which is the focus of the issue @fprerez linked to(jupyter/nbconvert#328), as long as the width and height are wrapped in quotes. If this is primarily about rst intermediate output, I'll have to think about how to best solve this. |
AFAICT, it works with When using It's probably possible to detect In the long run, I want to get rid of the intermediate RST (and at the same time Regarding a CommonMark extension for link attributes, I would be careful not to rush into introducing the syntax that Regarding image/figure captions, this is also a |
Thanks @mgeier for the extra details on the caption situation - I don't really care much for it, was just surprised to notice it. And @mpacer, this is indeed in the context of sphinx: it works great on standalone It seems at this point, the most viable path forward is the (somewhat hackish) solution proposed by @mgeier, to catch Thanks for the input!! |
This issue should be fixed with #438 (since the issue didn't explicitly request the |
This feature is now available in the latest |
There is some background discussion in this Jupyter notebook issue, but the gist of the issue is that nbsphinx currently doesn't recognize images declared e.g. as
only ones that use the plain markdown syntax:
This obviously precludes passing (useful) things like custom size hints. I don't know if this is easy to fix in nbsphinx itself or if there's an underlying tool (say pandoc) that does the heavy lifting with the files... But I figured I'd mention it, it would help us use whichever syntax is more sensible in a given setting.
For now, for Jupyter we'll work around it in our docs by limiting ourselves to the
![..](..)
syntax.The text was updated successfully, but these errors were encountered: