Create global image path #12747
Replies: 5 comments
-
|
Just an FYI, you know that if you start an image path with .. image:: /images/image.png |
Beta Was this translation helpful? Give feedback.
-
|
@chrisjsewell
I know that, but for my project, the image path is like this:
"source/_external/_images/folio"/folios properties.PNG
The part in apostrophe is the one I want to replace by a global identifier.
Le 7 août 2024 23:22:47 GMT+02:00, Chris Sewell ***@***.***> a écrit :
…Just an FYI, you know that if you start an image path with `/` it is already relative to the source folder, i.e. you can do:
```restructuredtext
.. image:: /images/image.png
```
--
Reply to this email directly or view it on GitHub:
#12747 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
+1 to be able to add image search paths.. this would be very useful for modular documentation from different places, for instance different README.rst that display images on git web repos while browsing, while the sphinx root is located somewhere else :-) |
Beta Was this translation helpful? Give feedback.
-
|
i recommend making a sphinx transform for that. where is replace git lfs pointers with a github raw url, to not upload 'again' and due to gh pages does not support lfs anyway |
Beta Was this translation helpful? Give feedback.
-
|
Recently, I wrote an extension that supports flexible template rendering in Sphinx. It should meet your needs. pip install "sphinxnotes-render[ext]"Add the following code to your render_ext_data_define_directives = {
'screenshots': {
'schema': {
'name': 'str, required',
},
'template': {
'text': '.. image:: source/_external/_images/folio/{{ name }}.png',
},
},
}the above config create a directive called For more details, please refer to https://github.com/sphinx-notes/render and https://sphinx.silverrainz.me/render/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone, I'm currently in the process of writing the documentation for my app.
it includes a lot of screenshots and I've wondered if I could create a global link to the image folder.
Example:
Ive got the image folder in source/images, I want to set a link with a identifier so I could write Image_folder_identifier/app login screenshot.png
Is it possible?
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions