better way to set img src file for an avatar? #878
|
Hello,
I am using avatars. I write sphinx docs in markdown. I usually set an image like: using i the only way to get the avatar to find the image was to use a full path. e.g.: Is there something I am missing/doing wrong? Thank you. |
Replies: 3 comments 4 replies
|
Can you say a little more about what you mean by "full path"? The examples in the docs use paths that are written relative to the docs directory, e.g. ````{grid} 1 2 3 3
:gutter: 1
```{grid-item-card} sd-avatar-xs
<img src="images/ebp-logo.png" class="sd-avatar-xs sd-border-1">
```
```{grid-item-card} sd-avatar-sm
<img src="images/ebp-logo.png" class="sd-avatar-sm sd-border-1">
```
```{grid-item-card} sd-avatar-md
<img src="images/ebp-logo.png" class="sd-avatar-md sd-border-1">
```
```{grid-item-card} sd-avatar-lg
<img src="images/ebp-logo.png" class="sd-avatar-lg sd-border-1">
```
```{grid-item-card} sd-avatar-xl
<img src="images/ebp-logo.png" class="sd-avatar-xl sd-border-1">
```
````
where those images live in but this is something I have found myself confused by before -- it can depend on how the rest of your project is set up (I think) |
|
🤔 I could be wrong but I think the secret sauce is enabling the myst extension If this is the project you're working on, then I think you don't have it enabled, right? See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#images for more info on what's going on here edit: adding context from that part of the myst parser docs:
So your intuition is right I think that you need to do a little extra work here so Sphinx can resolve things correctly |
🤔 I could be wrong but I think the secret sauce is enabling the myst extension
html_imagelike so:https://github.com/executablebooks/sphinx-design/blob/fd7912f5da5f681daee17bbc7a6bcee117f006a8/docs/conf.py#L56
If this is the project you're working on, then I think you don't have it enabled, right?
https://github.com/solarslurpi/GrowBuddy/blob/1734c1b870f6ebd121df046461ae6991d8adb60e/docs/conf.py#L41
See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#images for more info on what's going on here
edit: adding context from that part of the myst parser docs: