GCBallesteros / jupytext.nvim

Jupyter notebooks on neovim powered by Jupytext
66 stars 14 forks source link

Convert Jupyter Notebooks with R code cells to ```r code cells #18

Open ClemensKohl opened 4 months ago

ClemensKohl commented 4 months ago

Hi, Fantastic plugin! I am running Jupyter Notebooks with an R Kernel and when converting these files to Markdow the code cells are converted to code blocks starting with ```R. However many other plugins such as quarto.nvim and otter.nvim expect code blocks to start with ```r for e.g. syntax highlighting. Is there a setting that I can make to ensure that these cells are converted to code blocks starting with ```r? For reference, here is the metadata from an example notebook:

---
jupyter:
  jupytext:
    text_representation:
      extension: .md
      format_name: markdown
      format_version: '1.3'
      jupytext_version: 1.16.1
  kernelspec:
    display_name: R 4.2
    language: R
    name: ir42
---

And my lazy.nvim config:

  {
    "GCBallesteros/jupytext.nvim",
    config = function()
      require("jupytext").setup({
        style = "markdown",
        output_extension = "md",
        force_ft = "markdown",
      })
    end,
  }

Thanks a lot for your time and help!

GCBallesteros commented 4 months ago

Hi @ClemensKohl I'm afraid this is out of the control of jupytext.nvim. I don't know if jupytext has support for this.

Either the nvim plugins you cite or jupytext are the ones that would have to change to deal more gracefully with such a situation.

If it ends up being that jupytext has some flag to control this we could look for a way to pass in the additional parameters required.

ClemensKohl commented 3 months ago

I asked the same question on the jupytext github and will report back if there is a solution!