Skip to content
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

code-cell caption meta with eval or glue directive #654

Open
mfouesneau opened this issue Jan 28, 2025 · 0 comments
Open

code-cell caption meta with eval or glue directive #654

mfouesneau opened this issue Jan 28, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@mfouesneau
Copy link

Describe the bug

context

I define a code-cell as follows

---
caption: |
      here is a long caption with variables {eval}`n_sources`.  and some more text
name: fig_name
tags: "[hide-input]"
---
# code to generate a figure 
pass

expectation
I expected the eval (or glue) to be evaluated as it is for a code-block

bug
But instead, it seems to understand the directive but not doing the right operation
I do not have any error message, but the caption breaks the line:

n_sources
.  and some more text

No additional information from the console

problem
This is a problem for doing a figure with a dynamic caption.

Maybe there is a difference manner to achieve a similar output?

Reproduce the bug

write a md file with the above content, compile and serve.

List your environment

Jupyter Book      : 1.0.3
External ToC      : 1.0.1
MyST-Parser       : 2.0.0
MyST-NB           : 1.1.2
Sphinx Book Theme : 1.1.3
Jupyter-Cache     : 1.0.1
NbClient          : 0.10.2
@mfouesneau mfouesneau added the bug Something isn't working label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant