Conversation
ufukty
commented
May 9, 2026
- resolves Internal documentation #63
|
While this adds diagrams written with Mermaid.js (mmdc 11.14.0), i didn't add it as a dev dependency as it doubled the package lock file. |
ufukty
left a comment
There was a problem hiding this comment.
GitHub still miss img tags with srcset inside Markdown files.
…r attaching diagrams with using the hack vscode preview ignoring `source` tags within `picture` tags and github gives presedence to `source` tags. https://github.blog/developer-skills/github/how-to-make-your-images-in-markdown-on-github-adjust-for-dark-mode-and-light-mode
| <picture> | ||
| <source srcset="./diagrams/structure@2x.png 2x"> | ||
| <img srcset="./diagrams/structure@2x.png 2x"> | ||
| </picture> |
There was a problem hiding this comment.
Note for future,
This "hack" works at the moment. But will cause duplicate placements once GitHub or VS Code enhance their srcset support.
This combination seems redundant but each attachment works in either VS Code Markdown Preview or GitHub Markdown Preview.
GitHub seems to allow srcset attribute only on the source tags contained inside picture elements, and VS Code only allows the attribute on the img tags.
Hardcoding the Markdown file for the diagram widths is worse, as they are very dynamic.
Both mediums ignore the other's solution.
| <picture> | ||
| <source srcset="./diagrams/config-cache@2x.png 2x"> | ||
| <img srcset="./diagrams/config-cache@2x.png 2x"> | ||
| </picture> |