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

Support separate alt text and captions in Markdown content #14

Merged
merged 13 commits into from
Sep 18, 2024

Conversation

conradolandia
Copy link
Collaborator

This PR replaces a plugin to add support for proper Alt text from markdown sources using mdsvex. The new plugin is rehype-title-figure.

With this new implementation, ![This is alt text](image.jpg "This is the caption") will render like <figure><img src="image.jpg" alt="This is alt text" title="This is the caption"/><figcaption>This is the caption</figcaption></figure>.

An image without a caption will not produce a figure nor figcaption, but will produce an img with an alt attribute: ![This is alt text](image.jpg) will render like <img src="image.jpg" alt="This is alt text" />.

…er support for Alt text from markdown besides caption text
Copy link

netlify bot commented Sep 16, 2024

Deploy Preview for spyder-svelte-website-preview ready!

Name Link
🔨 Latest commit d4e96d9
🔍 Latest deploy log https://app.netlify.com/sites/spyder-svelte-website-preview/deploys/66ea1521b91abe00080490ab
😎 Deploy Preview https://deploy-preview-14--spyder-svelte-website-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except that the captions are retained in the alt text field. Simply leaving it empty would be a better alternative, as it avoids repeating the same thing twice that does not replace or describe the actual content of the image.

Given there are a relatively small number of them and they are being modified anyway, I just went ahead and wrote alt text for them, leaving it as suggestions you can apply.

src/lib/content/code-analysis.md Outdated Show resolved Hide resolved
src/lib/content/conda.md Outdated Show resolved Hide resolved
src/lib/content/developer-tools.md Outdated Show resolved Hide resolved
src/lib/content/developer-tools.md Outdated Show resolved Hide resolved
src/lib/content/matplotlib.md Outdated Show resolved Hide resolved
src/lib/content/numpy.md Outdated Show resolved Hide resolved
src/lib/content/pandas.md Outdated Show resolved Hide resolved
src/lib/content/projects.md Outdated Show resolved Hide resolved
src/lib/content/search.md Outdated Show resolved Hide resolved
src/lib/content/sympy.md Outdated Show resolved Hide resolved
conradolandia and others added 11 commits September 17, 2024 17:33
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
… part of the experiments to fix the issue with double quotes, and it's interfering with metadata fields from the blog posts in the build process. Will investigate further
@CAM-Gerlach CAM-Gerlach added the bug Something isn't working label Sep 18, 2024
@CAM-Gerlach CAM-Gerlach self-requested a review September 18, 2024 00:37
@CAM-Gerlach CAM-Gerlach changed the title Replace plugin rehype-figure with rehype-title-figure Support separate alt text and captions in Markdown content Sep 18, 2024
Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thanks @conradolandia !

@CAM-Gerlach CAM-Gerlach merged commit 614c5d1 into spyder-ide:main Sep 18, 2024
2 checks passed
@conradolandia conradolandia deleted the figures-alt branch September 18, 2024 00:55
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

Successfully merging this pull request may close these issues.

2 participants