Thanks Stefano. I have never used symlinks before - do you have a public 
repo I could have a look at, or point me towards instructions on how I 
would do that?

I don't know about your reason for avoiding duplicate files, but I really 
would like to make the repo as light as possible. Currently the files in my 
docs folder make ~60% of the whole repo size, and having all images as 
duplicates inside docs/_images doesn't help

On Tuesday, 31 March 2020 09:49:59 UTC+2, Stefano David wrote:
>
> Hi Moritz,
>
> On Monday, 30 March 2020 11:30:13 UTC+2, Moritz Lürig wrote:
>>
>> Thanks, Stefano.
>>
>> I guess some confusion on my side arises from Sphinx behavior to copy 
>> images to an "_images" folder inside the docs folder. Because I am using 
>> multiple source directories (using `sphinx-multibuild`) and also jupyter 
>> notebooks converted to html (using `nbsphinx`) I am trying to avoid 
>> multiple locations at which the images are stored. Therefore, my original 
>> question remains: why to relative paths work locally, but not online? I.e. 
>> having a central "assets" works locally, but not online - is that because 
>> if github pages are specified to be in the docs folder of the master 
>> branch, they cannot go beyond that level?
>>
> Yes, images by default end up in build/_images, so you should build your 
> raw HTML code to point to that directory, but I understood you already did 
> this.
>
> About relative paths and content "outside" the source folder: I use 
> withouth problems symlink to deal with this. I have different documents in 
> a same repository, each in a separate directory which is also a separate 
> source folders, but I also have some common content for both projects and 
> extensions I use for both of them. So I put the files for this in a 
> separate directory (call it "common") and I successfully use symlinks to 
> access content in "common". I do not know, however, if this is a feasible 
> approach or if it should be avoided. In the latter case, I'd be happy to 
> accept suggestions.
>
> Hope this helps,
> Stefano
>
>
>
>>
>> On Thursday, 26 March 2020 08:35:51 UTC+1, Stefano David wrote:
>>>
>>>
>>>
>>> On Wednesday, 25 March 2020 12:16:35 UTC+1, Moritz Lürig wrote:
>>>>
>>>> My project looks like this:
>>>>
>>>> proj ==> root dir
>>>> proj/docs ==> sphinx build dir
>>>> proj/assets ==> images 
>>>>
>>>> https://github.com/mluerig/phenopype ==> repo
>>>> https://mluerig.github.io/phenopype/ ==> docs
>>>> https://mluerig.github.io/phenopype/tutorial_2_phenopype_workflow.html ==> 
>>>> converted jupyter notebooks
>>>>
>>>> Problem: I use relative paths in html tags to add images to my 
>>>> documentation:
>>>>
>>>> <img src="../assets/figures/header.png">
>>>>
>>> If you add figures properly using figure:: or image:: you should just 
>>> write e.g., 
>>>
>>> .. image:: /asset/figures/header.png 
>>>
>>> But looking quickly at your repo, all images are included via raw:: 
>>> html, so my guess is that this is not sphinx's fault, but that the /assets/ 
>>> directory is not correctly rechable from the place where the final html is 
>>> located.
>>>
>>> my 2 cents,
>>> Stefano
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/567db79e-0c36-43b8-881d-ce2ca31065da%40googlegroups.com.

Reply via email to