I want to embed the value of a variable inside a markdown cell, which should be possible according to quarto “inline code” documentation:
```{python}
radius = 5
```
The radius of the circle is `{python} radius`
But when I try the suggested syntax, it gets rendered as the back-ticked string {python} radius in the generated HTML, instead of the expected value (5).
Do I need to do something out of the default to enable this functionality?
Thanks for the reply!
I tried your suggestion, but I got the same result. Maybe some parts of it got scrambled in the formatting?
To be clear: I am not trying to render a Quarto document directly, I am trying to render a notebook using nbdev, and since I know I can render inline variables in Quarto with the syntax I linked, I was wondering if this functionality was also available in nbdev. The variable I am trying to render is actually computed in a notebook cell.
My Quarto and nbdev versions are both the latest available (1.5.57 and 2.3.31 respectively)
Also, nbdev allows you to write tests inline with your code in your notebook. After writing a function, you can immediately write tests for it in the following cells. Once your code is ready, nbdev can automatically convert your notebook into Python scripts.
1 Like