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

Attachments getting stripped #748

Closed
sean-parent opened this issue Feb 26, 2021 · 1 comment
Closed

Attachments getting stripped #748

sean-parent opened this issue Feb 26, 2021 · 1 comment

Comments

@sean-parent
Copy link

The following notebook losing the attachment when converting to markdown. Is there any way to preserve it? In JupyterLab this is not stored in the notebook or cell metadata.

stripped_attachment.md

---
jupyter:
  jupytext:
    formats: ipynb,md
    text_representation:
      extension: .md
      format_name: markdown
      format_version: '1.3'
      jupytext_version: 1.10.0
  kernelspec:
    display_name: Python 3
    language: python
    name: python3
---

Adding an attachment:
![image.png](attachment:c280a928-8f3f-4c05-9509-f74ac050f29e.png)

stripped_attachment.ipynb

{
 "cells": [
  {
   "attachments": {
    "c280a928-8f3f-4c05-9509-f74ac050f29e.png": {
     "image/png": "iVBORw0KGgoAAAANSUhEUgAAAB8AAAAZCAYAAADJ9/UkAAAD2UlEQVRIDe3V60+bVRzA8f0hRhMTDb7zjdNkmQMGDOgy3BpZgMlkiei8QOabvdC9c9M445vFGGOMmugWoGNcKysM6bBcWqAt9AKdUFpoKS3XXh6ec3r5mpY3SxbG6EwWE5/kSU5Ozu98fr/fk3OeQzzD59AztPlv4cmoGyV4D9KCdDqNy+XCYDCQTCYP3MQnqjyTSpDeiUAmTXzue2JTH7ATNrO2ts7IyAh6vZ6BgYFcMgfJYF88nVJJLP5KbOodRHiY4GAzwlbO5pCG2NosRuNwDu7s7MTr9R7E3v+bJ9UEkakbqLYyElN1BE3fEuyrQlgKCVua2Nxcpbu7h/7+frq6uoglBEklgozOoMbWHpvMvpWTShL3T7DYfhbpKCJq/wiv4QqR/hJ2RguJzNzA7w9iNluwWm2s+h1EnV+i2OtYGr2eP55JKsQ9P6HONhMev8ZSjxbp0hCdvMDiH5fYGDxGfLyCdc/vZDK7TsT8BYlxDfG/SghZf8gfT0mFkOUqcq4UxapleegKgd4K5PQJ1kcb8XbUo1g0bI9pUYKmHBQxfYowF+FtLUREV/PHM5kM8dADgt3nkTPHiVpqWey7RMhQgeqsY6lHw0rvMYTzFNuj1QSGPmNzuBoxWYivu4FMUs0fz0XmEnCzMvg+wlnJ1lgt3t4mVgfKUZ21qPYapO0kqqUQZUKDcJ1HWEtZ6L1AWipPh6fiCyQ811gdu0pAfwp19m3WTTXMt1YiHA1IRw3CUoywFOXGcu5DhK0S/50ykmo0f1xKSdR/j8R4McpkOT59I8u9Z1CspxHTZ5HT1QjrScTUCYS1EulqQHo+yXViqf111OhyfrjP58Pz4G/GTfeJmL4mev8oicmTzHfUsqgrRrjfRTpqkba3kPYzu6/7PaTnY9SpSgLtr7ITceaH63S63J3dq+/DM+skaPqGreEjxMfLCN0tYceePffndls9rUXaTyMddUjXOeIjb+K7VYASsuWHb21t0dLSgsFwF9PoGE6Hm7D1F0L6I0j7caSrHuluRGarddbnKlfNRUSH3yDcUYDn59eQ8Uh+eDYqtLLCbZ2Onp4eQuEI6VSKiEPHYsthpF2D9FxEzjUj5y4ip7Vs/3mYwO2X8P34PP6h65BO5Y9nIwOBAEajkUQintsoe/Y35o1424oQk6XIGS3CVkXMdJQV3cvMf/ccrpv1KFuPv2Cym+1/twNC7P67Hy4jFnIxe7OKUFsB4a5XWLr1IpavXmDuzucoGysPL91z/ET4XtGqssnC5G+4Wptwt11mwztBOin3Wv7I/FPhj+x2wIn/8QM27N9Z/g/+LVBEUNhLiAAAAABJRU5ErkJggg=="
    }
   },
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Adding an attachment:\n",
    "![image.png](attachment:c280a928-8f3f-4c05-9509-f74ac050f29e.png)"
   ]
  }
 ],
 "metadata": {
  "jupytext": {
   "formats": "ipynb,md"
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
@mwouts
Copy link
Owner

mwouts commented Mar 2, 2021

Hi @sean-parent , that is correct, attachments are not stored in the .md file, and we have no plans to change that, because it would make the .md file too large, and the diff less readable (sorry 😄 )

What you can do is either

Hope that helps!

@mwouts mwouts closed this as completed Dec 10, 2021
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