From 065a3925af7df8789989d643e682be506b3aa8d4 Mon Sep 17 00:00:00 2001 From: Dan Davis Date: Thu, 5 Sep 2019 15:32:31 -0400 Subject: [PATCH 1/3] Hopefully fix issue #30 - Since the image is attached to this page, using ri:attachment should be better than ri:url - The documentation is at https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html#ConfluenceStorageFormat-Images at the time of this writing. --- nbconflux/confluence.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nbconflux/confluence.tpl b/nbconflux/confluence.tpl index 895f435..9ce17eb 100644 --- a/nbconflux/confluence.tpl +++ b/nbconflux/confluence.tpl @@ -145,7 +145,7 @@ unknown type {{ cell.type }} {% block data_png scoped %}
{%- if 'image/png' in output.metadata.get('filenames', {}) %} - + {%- endif %}
{%- endblock data_png %} @@ -153,7 +153,7 @@ unknown type {{ cell.type }} {% block data_jpg scoped %}
{%- if 'image/jpeg' in output.metadata.get('filenames', {}) %} - + {%- endif %}
{%- endblock data_jpg %} @@ -232,4 +232,4 @@ unknown type {{ cell.type }} {%- endif %} -{%- endblock footer-%} \ No newline at end of file +{%- endblock footer-%} From 8a01a60b160a423df1102043baace72ad376f69e Mon Sep 17 00:00:00 2001 From: Dan Davis Date: Thu, 5 Sep 2019 15:50:57 -0400 Subject: [PATCH 2/3] Fix tests relevant to issue #30 --- tests/test_nbconflux.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_nbconflux.py b/tests/test_nbconflux.py index c9cbfdc..3251a18 100644 --- a/tests/test_nbconflux.py +++ b/tests/test_nbconflux.py @@ -94,7 +94,7 @@ def test_post_to_confluence(notebook_path, page_url, server): # Makrdown image is assert '' in html # Image is a properly versioned attachment - assert '' in html + assert '' in html # Input hidden, output shown assert 'sns.violinplot' not in html # Output hidden, input shown @@ -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) \ No newline at end of file + assert 'Could not locate' in str(ex.value) From 1879983d4a332f645f140cbeb732240b88f9770a Mon Sep 17 00:00:00 2001 From: Dan Davis Date: Thu, 5 Sep 2019 16:14:50 -0400 Subject: [PATCH 3/3] Update pull request to also address #32 --- nbconflux/confluence.tpl | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/nbconflux/confluence.tpl b/nbconflux/confluence.tpl index 9ce17eb..decccd8 100644 --- a/nbconflux/confluence.tpl +++ b/nbconflux/confluence.tpl @@ -202,27 +202,29 @@ unknown type {{ cell.type }}

This page originated from the notebook {{ resources['notebook_filename'] }} which is attached to this page for safe keeping.

{%- endif %} +{% if resources.enable_style %} https://nbviewer.jupyter.org/static/build/notebook.css + 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; + } +]]> +{% endif %} {%- if resources.enable_mathjax %}