mwouts / jupytext

Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts
https://jupytext.readthedocs.io
MIT License
6.65k stars 386 forks source link

Unable to pair Quarto qmd file with ipynb notebook #1100

Open fast-90 opened 1 year ago

fast-90 commented 1 year ago

I have the following demo.qmd with the following metadata:

---
title: Demo
jupyter: myenv
execute:
  cache: true
---

Running jupytext --set-formats notebook,qmd demo.qmd updates the metadata to:

---
title: Demo 
execute:
  cache: true
jupyter:
  jupytext:
    formats: 'ipynb,qmd:quarto'
    text_representation:
      extension: .qmd
      format_name: quarto
      format_version: '1.0'
      jupytext_version: 1.14.6
  kernelspec:
    display_name: myenv
    language: python
    name: myenv
---

However, no demo.ipynb file is produced. If I now run jupytext --to notebook demo.qmd, no ipynb notebook is produced either.

If I run jupytext --to notebook demo.qmd with the first version of the metadata without the jupytext specification (see at the top), it does produce a demo.ipynb file. However, it is not paired with demo.qmd. If I subsequently try to pair them after this (e.g. via jupytext --set-formats ipynb,qmd demo.qmd or jupytext --sync), demo.ipynb actually gets deleted.

Not sure how I am able to get this work?

Jupytext 1.14.6 Quarto 1.3.361

mwouts commented 1 year ago

Hey @fast-90 , I am sorry but I cannot reproduce the issue documented here. I have tried with your commands, and also with jupytext --set-formats qmd,ipynb demo.qmd, everything seemed to work nicely. The only difference that I noticed was the formats - I got qmd rather than the full qmd:quarto format, but both should be the same:

---
title: Demo
execute:
  cache: true
jupyter:
  jupytext:
    formats: 'qmd,ipynb'
    text_representation:
      extension: .qmd
      format_name: quarto
      format_version: '1.0'
      jupytext_version: 1.15.0.dev2
  kernelspec:
    display_name: myenv
    language: python
    name: myenv
---

I have been using the latest development version of jupytext, and the same version of Quarto as you have:

quarto --version
1.3.361