quarto-dev / quarto-dev/quarto-cli

convert: read the .ipynb converted files as commonmark_x

Open
#4,905 6 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Mar 21, 2023.

convert early-in-release engines-jupyter enhancement
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

Quarto 1.2.335 on Mac OS X 12.6.1 seems to render a list only, if there is an empty line before the list. So the following quarto file test.qmd will not render the list

---
title: "Introduction to markdown lists"
subtitle: ""
author: Mark Down
date: 2023-01-02
---

## Introduction to lists

This is an example of a list
- first item  
- second item
- third item

To make this example work as expected ( see babelmark ), one has to add an empty line before the list like

This is an example of a list

- first item  
- second item
- third item

One could argue this is just a documentation bug, because it is not mentioned in https://quarto.org/docs/authoring/markdown-basics.html#lists .

However it leads to inconsistent behaviour when rendering iPython notebooks with quarto. The following notebook test.ipynb

{
 "cells": [
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "---\n",
    "title: \"Introduction to markdown lists\"\n",
    "subtitle: \"\"\n",
    "author: Mark Down\n",
    "date: 2023-01-02\n",
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Introduction to lists\n",
    "\n",
    "This is an example of a list\n",
    "- first item  \n",
    "- second item\n",
    "- thrid item"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "name": "python",
   "version": "3.10.6"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}

will render the list correctly when using

jupyter nbconvert --execute --to html test.ipynb

However it will not render the list when using

quarto render test.ipynb --execute

This inconsistent behaviour is annoying for users, because it means one has to change the markdown dialect inside jupyter notebooks when one wants to use quarto for rendering.

I understand quarto is using pandoc under the hood, so this behaviour probably cannot be changed easily. But maybe an option in the preamble could be given when rendering jupyter notebooks, to let quarto select the correct renderer for a given jupyter notebook.

P.S.

❯ quarto check

[✓] Checking Quarto installation......OK
      Version: 1.2.335
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.6
      Path: /Users/<username>/.local/share/virtualenvs/test2-O5T_d_dR/bin/python3
      Jupyter: 5.3.0
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /opt/homebrew/Cellar/r/4.2.1_2/lib/R
      LibPaths:
        - /opt/homebrew/Cellar/r/4.2.1_2/lib/R/library
      rmarkdown: (None)

      The rmarkdown package is not available in this R installation.
      Install with install.packages("rmarkdown")
Checklist
  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
  • Please provide the output of quarto check so we know which version of quarto and its dependencies you're running.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.