# \[ANN\] Native Julia engine for quarto using QuartoNotebookRunner.jl

**URL:** <https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753>\
**Category:** Package Announcements\
**Created:** [April 10, 2024, 5:48am UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753 "2024-04-10T05:48:52Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [April 14, 2024, 2:52pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/41 "2024-04-14T14:52:01Z")

</div>

I find it useful to convert from qmd to ipynb using [`quarto convert`](https://quarto.org/docs/tools/jupyter-lab.html#converting-notebooks) where I can run code lines one cell at a time. Quarto can preview/render ipynb without re-running the cells, only displaying their outputs if they have been run. This is useful for interactive development and execution of a “Quarto document”. Once I am happy with the ipynb’s code output, I can convert back to qmd, going back and forth as needed.

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [April 14, 2024, 3:49pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/42 "2024-04-14T15:49:33Z")

</div>

I’m aware of what Quarto is, but also there’s no reason it can’t be made more interactive, and indeed the backends for other languages _are_ more suited to interactivity.

I was just curious if there was interest in implementing these features in the julia one or not, but I guess I’ll take that as a “no”.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [April 14, 2024, 3:58pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/43 "2024-04-14T15:58:24Z")

</div>

> and indeed the backends for other languages _are_ more suited to interactivity

Could you elaborate on that? As far as I know the R quarto experience in RStudio is not that different from the Julia experience in VSCode, just that you can optionally show output of code chunks inline in the qmd. But if I understand correctly, you don’t get “final” looking output inline (i.e. with all the correct formatting, because that needs pandoc). So the other option is preview mode of the whole document, which we also have.

So as far as I can see, you either go the jupyter notebook route and match python’s interactive experience, or you go the qmd route and are pretty close to R, minus the inline outputs which I guess could be added to the VSCode quarto extension.

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [April 14, 2024, 4:29pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/44 "2024-04-14T16:29:33Z")

</div>

I know the jupyter backend has an option for caching of outputs which I’d say is an okay start, and basically just a dumber version of reactivity.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [April 18, 2024, 12:05pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/45 "2024-04-18T12:05:36Z")

</div>

We just released QuartoNotebookRunner 0.10. ( ** ~~This is not yet automatically used in the latest quarto prerelease, but you can test it out using the instructions at the end of this post~~ ** This is now available starting with in prerelease [Release v1.5.31 · quarto-dev/quarto-cli · GitHub](https://github.com/quarto-dev/quarto-cli/releases/tag/v1.5.31))

This version adds the ability to use `{r}` code blocks which are rendered using RCall.jl if it’s available. This is similar to using the `R""` string macro but more convenient, plus you get correct R syntax highlighting:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/7/a7b1a68ceb78bc1097476bd7fc6d06517f927beb.png)

You can also use parameterized notebooks now. You specify defaults in the frontmatter like this:

```yaml
params:
    a: 1
    b: "2"

```

And then use these in your script as normal variables like

````md
```{julia}
println("a is ", a, " and b is ", b)
```

````

You can then render the notebook with different parameters like `quarto render somenotebook.qmd -P a:4` as otherwise described here [Parameters – Quarto](https://quarto.org/docs/computations/parameters.html)

## How to test the latest QuartoNotebookRunner with quarto prereleases

Each quarto version specifies a specific QuartoNotebookRunner version it wants to use. That’s the one that automatically gets set up for you in the background. If you want to use a different version, for example to test this new functionality in 0.10, you can, from prerelease 1.5.30 on [Release v1.5.30 · quarto-dev/quarto-cli · GitHub](https://github.com/quarto-dev/quarto-cli/releases/tag/v1.5.30) use the env variable `QUARTO_JULIA_PROJECT` to set a different environment where quarto will try to load QuartoNotebookRunner from.

So you could do `]activate some/dir` then `]add QuartoNotebookRunner` and then `QUARTO_JULIA_PROJECT=some/dir quarto render somefile.qmd`

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [April 18, 2024, 12:55pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/46 "2024-04-18T12:55:11Z")

</div>

Really, really cool.

---

<div class="post-metadata">

**Author:** ![dmbates](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmbates/32/44_2.png) [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Post date:** [April 19, 2024, 3:25pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/47 "2024-04-19T15:25:11Z")

</div>

Is there some example of the use of `{r}` blocks to create plots that we could look at? Perhaps in the test/examples directory of the `QuartoNotebookRunner` package? I have been grepping around without success.

---

<div class="post-metadata">

**Author:** ![dmbates](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmbates/32/44_2.png) [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Post date:** [April 19, 2024, 3:36pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/48 "2024-04-19T15:36:23Z")

</div>

I found the test/examples/integrations subdirectory.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [April 23, 2024, 12:32pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/49 "2024-04-23T12:32:52Z")

</div>

The latest prerelease has version 0.10 included [Release v1.5.31 · quarto-dev/quarto-cli · GitHub](https://github.com/quarto-dev/quarto-cli/releases/tag/v1.5.31)

---

<div class="post-metadata">

**Author:** ![Xing\_Shi\_Cai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xing_shi_cai/32/14128_2.png) [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Post date:** [May 4, 2024, 4:18am UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/50 "2024-05-04T04:18:06Z")

</div>

I have been using Weave.jl for writing documents that requires Julia code for a while. (Mostly for writing quizzes and exams for my teaching.) It has been adequate. But I noticed that Weave.jl seems to have been dormant for quite some time now. If you have tried both quarto and Weave, have you found something in Weave but is not supported by quarto?

---

<div class="post-metadata">

**Author:** ![shravangoswami](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shravangoswami/32/221483_2.png) [@shravangoswami](https://discourse.julialang.org/u/shravangoswami)\
**Post date:** [May 7, 2024, 7:53pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/51 "2024-05-07T19:53:17Z")

</div>

I broke it too🤝!!  
did you find any solution?

---

<div class="post-metadata">

**Author:** ![stemann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stemann/32/4030_2.png) [@stemann](https://discourse.julialang.org/u/stemann)\
**Post date:** [May 7, 2024, 8:40pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/52 "2024-05-07T20:40:22Z")

</div>

[evaluate\_raw\_cells! / pwd() throws IOError: pwd(): no such file or directory · Issue #93 · PumasAI/QuartoNotebookRunner.jl · GitHub](https://github.com/PumasAI/QuartoNotebookRunner.jl/issues/93) was fixed by [try-catch pwd in case it's deleted after starting the server by jkrumbiegel · Pull Request #96 · PumasAI/QuartoNotebookRunner.jl · GitHub](https://github.com/PumasAI/QuartoNotebookRunner.jl/pull/96)

Edit: … so quarto 1.5.31+ should not have the issue…

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [July 28, 2024, 9:25pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/53 "2024-07-28T21:25:48Z")

</div>

Is it possible to use quarto on a remote server? So that it renders locally, but runs code remotely.

---

<div class="post-metadata">

**Author:** ![mike](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike/32/39_2.png) [@mike](https://discourse.julialang.org/u/mike)\
**Post date:** [January 22, 2025, 11:14am UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/54 "2025-01-22T11:14:20Z")

</div>

Possibly, never tried something like that before. Perhaps asking on the main quarto forums would get you a more definite answer since this isn’t really specific to our Julia backend.

---

<div class="post-metadata">

**Author:** ![mike](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike/32/39_2.png) [@mike](https://discourse.julialang.org/u/mike)\
**Post date:** [January 22, 2025, 11:27am UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/55 "2025-01-22T11:27:56Z")

</div>

We have just released 0.12.0 of QuartoNotebookRunner.

The major new feature available in this version is the ability to run different Julia versions in individual notebooks. Previously a limitation in the serialization of data between notebooks and the main process required the Julia versions to match. This has now been lifted.

You can access this feature by adding a valid `juliaup` channel to a notebook’s frontmatter, for example:

```qmd
---
engine: julia
julia:
    exeflags: ["+1.11.3"]
---

```

to run a notebook with Julia 1.11.3, the same syntax as starting a Julia REPL with a specific version. Note that QuartoNotebookRunner does not perform any behind-the-scenes management of `juliaup` channels. You will need to ensure that they are already installed, as well as ensuring that you already have `juliaup` installed.

It’s a rather large internal change to allow for this feature so if you run into any trouble then please open up issues and we’ll take a look.

* * *

Finally, there will be the usual delay in this version becoming available by default in `quarto` itself. Until then you’ll need to set the `QUARTO_JULIA_PROJECT` environment variable to a path to a Julia project directory that has version 0.12 of QNR already installed.

---

<div class="post-metadata">

**Author:** ![mike](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike/32/39_2.png) [@mike](https://discourse.julialang.org/u/mike)\
**Post date:** [February 18, 2025, 2:15pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/56 "2025-02-18T14:15:40Z")

</div>

Version 0.13.0 of QuartoNotebookRunner.jl has been release.

The main new feature shipping with this version is the addition of support for running Python cells within our backend. This relies on PythonCall.jl for code evaluation, and so should support anything that that package supports, including importing external Python packages, such as plotting, pandas, etc. All you’ll need to do is add `PythonCall` to you notebook’s `Project.toml` and `import` it into a cell at the start of the notebook, something like:

````qmd
---
engine: julia
---

```{julia}
import PythonCall
```

```{python}
import seaborn as sns
tips = sns.load_dataset("tips")
sns.relplot(
    data=tips,
    x="total_bill", y="tip", col="time",
    hue="smoker", style="smoker", size="size",
)
```

````

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/5/b5d9304ad92f14ed515349498a7420c3ebf6b449.png)

_Ensure you’ve installed the `seaborn` package before running it. Just use the `conda` command that PythonCall adds to the Pkg mode._

Julia values can be directly interpolated using `$` into Python code blocks, in the same way that we already support interpolation into R code blocks (managed by RCall.jl). This means that (if you really want to) you can use them all together and send R values to Python via Julia.

* * *

This is a very new feature addition, so might be buggy in places. Please do [open issues](https://github.com/PumasAI/QuartoNotebookRunner.jl/issues) if you run into any problems.

Currently `quarto` won’t have the updated version of QNR installed by default, that’ll take a little time to become available there. In the interim you can use the `QUARTO_JULIA_PROJECT` environment variable to set the path to a Julia environment that has an up-to-date version of the package.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [February 18, 2025, 6:50pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/57 "2025-02-18T18:50:30Z")

</div>

Adding a little CSS snippet here for one possible way to disambiguate cells with different languages:

```css
code.sourceCode.r::before{
    content:url('https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/r/r-original.svg');
    float:right;
    width: 20px;
}
code.sourceCode.python::before{
    content:url('https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/python/python-original.svg');
    float:right;
    width: 20px;
}
code.sourceCode.julia::before{
    content:url('https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/julia/julia-original.svg');
    float:right;
    width: 20px;
}

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/3/931a05d5879edbd9e2f241c1c008de4473023b3d.png)

---

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [February 19, 2025, 5:28pm UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/58 "2025-02-19T17:28:12Z")

</div>

That does look good - but it might be less obtrusive in grayscale?

It should suffice to add a `filter: grayscale(1);` tag.

---

<div class="post-metadata">

**Author:** ![tecosaur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tecosaur/32/23206_2.png) [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Post date:** [February 20, 2025, 2:29am UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/59 "2025-02-20T02:29:36Z")

</div>

> [@asinghvi17](#):
>
> That does look good - but it might be less obtrusive in grayscale?

I was thinking something similar, but it would perhaps be better again (more visually consistent) to source icons from [https://simpleicons.org](https://simpleicons.org) and display them with say `opacity: 0.4`.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [February 20, 2025, 8:28am UTC](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753/60 "2025-02-20T08:28:56Z")

</div>

```css
code.sourceCode.r::before{
    content:url('data:image/svg+xml; utf8, <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.746c-6.627 0-12 3.599-12 8.037 0 3.897 4.144 7.144 9.64 7.88V16.26c-2.924-.915-4.925-2.755-4.925-4.877 0-3.035 4.084-5.494 9.12-5.494 5.038 0 8.757 1.683 8.757 5.494 0 1.976-.999 3.379-2.662 4.272.09.066.174.128.258.216.169.149.25.363.372.544 2.128-1.45 3.44-3.437 3.44-5.631 0-4.44-5.373-8.038-12-8.038zm-2.111 4.99v13.516l4.093-.002-.002-5.291h1.1c.225 0 .321.066.549.25.272.22.715.982.715.982l2.164 4.063 4.627-.002-2.864-4.826s-.086-.193-.265-.383a2.22 2.22 0 00-.582-.416c-.422-.214-1.149-.434-1.149-.434s3.578-.264 3.578-3.826c0-3.562-3.744-3.63-3.744-3.63zm4.127 2.93l2.478.002s1.149-.062 1.149 1.127c0 1.165-1.149 1.17-1.149 1.17h-2.478zm1.754 6.119c-.494.049-1.012.079-1.54.088v1.807a16.622 16.622 0 002.37-.473l-.471-.891s-.108-.183-.248-.394c-.039-.054-.08-.098-.111-.137z"/></svg>');
    float:right;
    width: 20px;
    filter: opacity(0.25);
}
code.sourceCode.python::before{
    content:url('data:image/svg+xml; utf8, <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z"/></svg>');
    float:right;
    width: 20px;
    filter: opacity(0.25);
}
code.sourceCode.julia::before{
    content:url('data:image/svg+xml; utf8, <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11.138 17.569a5.569 5.569 0 1 1-11.138 0 5.569 5.569 0 1 1 11.138 0zm6.431-11.138a5.569 5.569 0 1 1-11.138 0 5.569 5.569 0 1 1 11.138 0zM24 17.569a5.569 5.569 0 1 1-11.138 0 5.569 5.569 0 1 1 11.138 0z"/></svg>');
    float:right;
    width: 20px;
    filter: opacity(0.25);
}

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/f/2fbbb94e18ae9bcf1c2beae738c02c5c21482321.png)

[Previous page](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753.md?page=2)

[Next page](https://discourse.julialang.org/t/ann-native-julia-engine-for-quarto-using-quartonotebookrunner-jl/112753.md?page=4)
