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

Add captions #8

Open
mrocklin opened this issue May 14, 2024 · 1 comment
Open

Add captions #8

mrocklin opened this issue May 14, 2024 · 1 comment

Comments

@mrocklin
Copy link

Lovely project. Thanks! I've really been enjoying using it.

Question: I'd like to be able to add captions to these images as I would do with a Sphinx Figure. Is there an easy way to do that? Does this project support a caption, or is there an easy pattern that people use to combine this with the figure directive?

@binste
Copy link
Contributor

binste commented May 20, 2024

Thanks for the feedback, happy to hear you find this useful! Honestly, I just moved this code out of the Altair repo into a separate codebase but I'm not too familiar with Sphinx. Seems like the relevant source code for the figure directive is https://github.com/docutils/docutils/blob/master/docutils/docutils/parsers/rst/directives/images.py#L159. We could add a caption option to the altair plot directive and then add it as a caption node to result in https://github.com/vega/sphinxext-altair/blob/main/sphinxext_altair/altairplot.py#L222.

I don't have the capacity to look into this right now but I could review a PR if someone can pick this up :)

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

No branches or pull requests

2 participants