Skip to content

Adding CSS Classes to Inline images (or disabling optimizations) #2839

@cycomachead

Description

@cycomachead

Proposal

Right now there's, as far as I know a few ways to write inline images in a paragraph:

  • standard Markdown syntax
  • raw HTML
  • A custom role — which feels a bit heavy-handed

Quarto/Pandoc/many flavors of md allow you to do ![alt](path){.class #id attrs=vals} type customizations.
I understand why MyST isn't using this syntax, but I'd really like to be able to do {image .class alt=x}\path`` or something and have it be built in. (and then teach the extension to treat the content as a URL.

Additional notes

Basically, in the book that I have right now (@snap-cloud/manual and https://docs.snap.berkeley.edu ) we've got hundreds of images, but exported at inconsistent resolutions and would like to style them to be more consistent. I've been fighting JB2 and myst this week trying to get something that feels natural, and looks OK. Right now I've made a new custom role, but it's a bit heavy. OTOH, not having to specify a class all the time is handy... Still, it'd be nice not to have to write JS to get a book looking good. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions