Skip to content

Support reading labelled code cells #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jpfeuffer
Copy link

@jpfeuffer jpfeuffer commented Apr 1, 2025

Hi!

Thanks for the neat plugin.
Unfortunately it does not support labels for referencing the outputs of qmd code blocks.
I started on at least ignoring the labels and saving them in the Block class.

Would be cool if we could generate an anchor for the admonition (or at least inside of it), to make it referencable with the default markdown reference syntax at least. Note this is not done yet.

My test:

---
title: "demo"
format:
  html:
    code-fold: true
jupyter: python3
---

For a demonstration of a line plot on a polar axis, see [here](#example-figure).
Test `{python} "hello " + str(4+5)`.

```{python}
#| echo: true
#| label: example-figure
#| tbl-cap: "dataframe" 
import pandas as pd

df = pd.DataFrame({
    "a": [1, 2, 3],
    "b": [100, 200, 300],
    "c": [0.01, 0.05, 0.001]
})
df
```

Sorry for the mix of topics and figure/tables 😄 was testing a lot of stuff. Can make it cleaner soon.

@jpfeuffer
Copy link
Author

jpfeuffer commented Apr 1, 2025

Now it also supports writing the label as id to the div.

I saw that for actual figures this is not necessary since quarto will add the label into the correct markdown figure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant