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. |
Beta Was this translation helpful? Give feedback.
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) |
Beta Was this translation helpful? Give feedback.
-
and hence my confusion. Why do the examples work?
…On Sat, Nov 19, 2022 at 8:27 AM David Nicholson ***@***.***> wrote:
Can you say a little more about what you mean by "full path"?
Does it work if you remove "http://127.0.0.1:8000/"?
The examples in the docs use paths that are written relative to the docs
directory, e.g.
https://github.com/executablebooks/sphinx-design/blob/fd7912f5da5f681daee17bbc7a6bcee117f006a8/docs/css_classes.md?plain=1#L282
where those images live in
https://github.com/executablebooks/sphinx-design/tree/fd7912f5da5f681daee17bbc7a6bcee117f006a8/docs/images
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)
—
Reply to this email directly, view it on GitHub
<#878 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIAGH2OYSR66H6BYUKBYDDWJD5YBANCNFSM6AAAAAASFK5EOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
🤔 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 |
Beta Was this translation helpful? Give feedback.
🤔 I could be wrong but I think the secret sauce is enabling the myst extension
html_image
like 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: