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

Caption integration with pymdownx.blocks.caption extension #52

Open
joapuiib opened this issue Oct 29, 2024 · 0 comments
Open

Caption integration with pymdownx.blocks.caption extension #52

joapuiib opened this issue Oct 29, 2024 · 0 comments

Comments

@joapuiib
Copy link

pymdownx.blocks.caption is a new extension that provides a markdown syntax to generate <figure> with captions.

![alt](url)
/// figure-caption
    attrs: {class: "glightbox-attribution"}
Attribution
///
/// figure-caption
    attrs: {class: "glightbox-description"}
Nested caption
///
/// figure-caption
    attrs: {class: "glightbox-title"}
Caption
///

will generate:

<figure id="__caption_1" class="glightbox-title"><figure id="__caption_1_1" class="glightbox-description"><figure id="__caption_1_1_1" class="glightbox-attribution">
<p><img alt="alt" href="url" /></p>
<figcaption>Attribution</figcaption>
</figure>
<figcaption>Nested caption</figcaption>
</figure>
<figcaption>Figure 1: Caption</figcaption>
</figure>

I see there's a Caption support in this plugin.

![Madeira, Portugal](../images/gallery/blueswen-madeira.jpeg){ data-title="Madeira, Portugal." data-description="Madeira, an autonomous region of Portugal, is an archipelago comprising 4 islands off the northwest coast of Africa. - Google" }

Would it be possible to integrate this plugin captions with the pymdownx.blocks.caption extension?

This extension provides a way of setting a class to <figure> elements. Maybe a class naming convention (similar to data-description) could be used to extract the information from the <figure> elements.

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

1 participant