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

Hopefully fix issue #30 and #32 #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions nbconflux/confluence.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ unknown type {{ cell.type }}
{% block data_png scoped %}
<div class="output_png output_subarea {{ extra_class }}">
{%- if 'image/png' in output.metadata.get('filenames', {}) %}
<ac:image><ri:url ri:value="{{ resources['attachments'][output.metadata.filenames['image/png']][2] }}" /></ac:image>
<ac:image><ri:attachment ri:filename="{{ output.metadata.filenames['image/png'] }}"/></ac:image>
{%- endif %}
</div>
{%- endblock data_png %}

{% block data_jpg scoped %}
<div class="output_jpeg output_subarea {{ extra_class }}">
{%- if 'image/jpeg' in output.metadata.get('filenames', {}) %}
<ac:image><ri:url ri:value="{{ resources['attachments'][output.metadata.filenames['image/jpeg']][2] }}" /></ac:image>
<ac:image><ri:attachment ri:filename="{{ output.metadata.filenames['image/jpeg'] }}"/></ac:image>
{%- endif %}
</div>
{%- endblock data_jpg %}
Expand Down Expand Up @@ -202,27 +202,29 @@ unknown type {{ cell.type }}
<p><em>This page originated from the notebook <a href="{{ resources['attachments'][resources['notebook_filename']]['download_url'] }}">{{ resources['notebook_filename'] }}</a> which is attached to this page for safe keeping.</em></p>
{%- endif %}

{% if resources.enable_style %}
<ac:structured-macro ac:macro-id="8250dedf-fcaa-48da-b12d-0f929c620dc4" ac:name="style" ac:schema-version="1">
<ac:parameter ac:name="import">https://nbviewer.jupyter.org/static/build/notebook.css</ac:parameter>
</ac:structured-macro>

<ac:structured-macro ac:macro-id="8250dedf-fcaa-48da-b12d-0f929c620dc4" ac:name="style" ac:schema-version="1">
<ac:plain-text-body><![CDATA[
a.anchor-link {
display: none !important;
}
body div.output_subarea {
max-width: none;
}
body.page-gadget #main {
width: auto;
}
body.page-gadget {
padding-top: 0;
}
]]>
a.anchor-link {
display: none !important;
}
body div.output_subarea {
max-width: none;
}
body.page-gadget #main {
width: auto;
}
body.page-gadget {
padding-top: 0;
}
]]>
</ac:plain-text-body>
</ac:structured-macro>
{% endif %}

{%- if resources.enable_mathjax %}
<ac:structured-macro ac:macro-id="c5e95bac-43c5-4db4-abd0-af1dfcf97384" ac:name="html" ac:schema-version="1">
Expand All @@ -232,4 +234,4 @@ unknown type {{ cell.type }}
</ac:plain-text-body></ac:structured-macro>
{%- endif %}

{%- endblock footer-%}
{%- endblock footer-%}
4 changes: 2 additions & 2 deletions tests/test_nbconflux.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_post_to_confluence(notebook_path, page_url, server):
# Makrdown image is <ac:image>
assert '<ac:image ac:alt="Juputer Logo"><ri:url ri:value="http://jupyter.org/assets/nav_logo.svg"></ri:url></ac:image>' in html
# Image is a properly versioned attachment
assert '<ac:image><ri:url ri:value="http://confluence.localhost/download/attachments/12345/output_6_0.png?version=6" /></ac:image>' in html
assert '<ac:image><ri:attachment ri:filename="output_6_0.png"/></ac:image>' in html
# Input hidden, output shown
assert 'sns.violinplot' not in html
# Output hidden, input shown
Expand Down Expand Up @@ -202,4 +202,4 @@ def test_post_to_unknown(notebook_path, bad_page_url, server):
with pytest.raises(ValueError) as ex:
nbconflux.notebook_to_page(notebook_path, bad_page_url, 'fake-username', 'fake-pass')

assert 'Could not locate' in str(ex.value)
assert 'Could not locate' in str(ex.value)