vericast / nbconflux

nbconflux converts Jupyter Notebooks to Atlassian Confluence pages
BSD 3-Clause "New" or "Revised" License
117 stars 33 forks source link

matplotlib images not working in my environment #30

Open danizen opened 4 years ago

danizen commented 4 years ago

The image is properly attached to the page, but is not displaying correctly. After I run nbconflux to update the page, and then request its content with body.storage expanded, I see this in the body.storage.value:

<ac:image><ri:url ri:value="https://wiki.nlm.nih.gov/download/attachments/146342104/output_15_1.png?version=3" /></ac:image>

However, when I fix this manually in the page with an attachment link, I see:

<ac:image ac:height="250"><ri:attachment ri:filename="output_15_1.png" /></ac:image>

It looks like the two lines that need a change are:

confluence.tpl line 148 confluence.tpl line 156

I will attempt a fix and get back to you.

Possible related issues: #17

danizen commented 4 years ago

I reviewed the Confluence Storage Format documentation, and satisfied myself that using ri:attachment is better than ri:url.

danizen commented 4 years ago

Note, markdown images could be made similar as follows:

danizen commented 4 years ago

Some more information for diagnosing the problem:

https://example.com/confluence/display/~davisda4/Page+with+DataFrame+and+Plot
https://example.com/confluence/pages/editpage.action?pageId=146342104

Seems like the code in nbconflux\exporter.py needs to keep everything to the left of the patterns it identifies as a prefix, and then use that to construct the URL for attachments that are uploaded.