gfm_viewer icon indicating copy to clipboard operation
gfm_viewer copied to clipboard

Image & Git Root Relative Path

Open sbertrand-witekio opened this issue 6 years ago • 3 comments

Hi,

I just added picture to my GitHub wiki page and found the following :

  • The image path is relative to the root of the git not to the page itself
    • My wiki page is in a folder and having the image in the same folder does not work

Using the GTM viewer, I now have an issue where my html pages are generated in the page folder ( not the root of the git ) which does not allow for git root relative image path to be found.

Would there be a way to have an option to have all html page generated in a designated directory ( like temp but one I can select ). I could then select my git root and relative image would work.

Thanks

sbertrand-witekio avatar Sep 12 '18 17:09 sbertrand-witekio

This seems to be very specific to GitHub wiki handling since it does not handle folders : https://github.com/sbertrand-witekio/relative-image-url/wiki/Image-Readme

sbertrand-witekio avatar Sep 12 '18 17:09 sbertrand-witekio

To investigate this, could you provide a link to a GitHub repo which:

  • has this kind of directory structure
  • renders properly when viewed on GitHub
  • does not render properly with GFM Viewer

For example, your repo, or a temporary one, or someone else's: then we can look into it. It's possible a solution would involve fixing up the IMG elements' paths, we do something similar at https://github.com/satyagraha/gfm_viewer/blob/2948c8cc8413ff63bee30adc34f07eaff3e1ee3d/plugin/source/code/satyagraha/gfm/support/impl/TransformerDefault.java#L129 .

satyagraha avatar Sep 13 '18 05:09 satyagraha

Hi, The example is as follow : Image on the root readme page is relative to the root, img/Kiku.jpg : https://github.com/sbertrand-witekio/relative-image-url/wiki/README Image on the readme page in the image folder : https://github.com/sbertrand-witekio/relative-image-url/wiki/Image-Readme

If all the web page of GFM Viewer were generated in the root directory ( as an option ) of the git wiki, then this behavior would match GitHub Wiki

sbertrand-witekio avatar Sep 13 '18 16:09 sbertrand-witekio