NASA-Openscapes / earthdata-cloud-cookbook

A tutorial book of workflows for research using NASA EarthData in the Cloud created by the NASA-Openscapes team
https://nasa-openscapes.github.io/earthdata-cloud-cookbook
Other
83 stars 30 forks source link

check & document rendering computational code: `{.bash}` v `{bash}` syntax #228

Open jules32 opened 12 months ago

jules32 commented 12 months ago

Carlos S from the Quarto team identified that the {bash} syntax will try to execute, despite the yml (see my original question below). Go through for render errors and fix; document this in the contributing section

We have a small .qmd with python and R cells that we execute in our JupyterHub with a base image. In the Python base image, we don’t have R installed, and despite having execute: eval: false in the .qmd’s yaml, we get an execution error.

jules32 commented 12 months ago

Update from Christophe: use {.python} rather than .python. - this made the rendered format as expected with the copy button.

as in the later case will identify the class as being .python and not python . The latter is equivalent to {..python}

You can also use

python without . as we document https://quarto.org/docs/authoring/markdown-basics.html#source-code The . before the name if for the class syntax in curly braces syntax. Like with div and spans

jules32 commented 11 months ago

Code chunks are executed if they are within curly brackets like {python}

There are 2 ways for computational code to be ignored:

```python
```{.python}

There are merits for each - python is cleaner and follows the rules

but {.python} has the consistency of the { } notation.

jules32 commented 11 months ago

Let's go with

```python

which follows the rules

stefaniebutland commented 11 months ago

We're addressing this in #234