-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relative image paths and links on root README not parsed? #158
Comments
I'm having a hard time locating where the links are in your docs that are causing problems for you. Could you be very specific for me please? |
Reproducible minimum working example I extended the full package test in this commit in my fork by an image and a relative link. This is an example image that should be displayed on github.com and the
generated documentation website.

The link to [somethingElse.markdown](doc/somethingElse.markdown) should also
work in both environments. Steps to reproduce issue:
Raw markdown (expected similar results in rendered version) Version of rosdoc
|
Thanks for the details. I don't have time for a few days to look specifically at your situation, but let me respond from memory about my general investigations in this area. I am aware of the general problem, and have tried to take steps to mitigate it, though not entirely successfully at this point. rosdoc2 copies portions of the original package source to a temporary location where the rendering software is run. This is because we add a lot of automatic documentation, and if we did not do that, the source files of your repo would be spewed with our stuff. Some of those copies did not preserve the original directory structure, but in the last few months changes have been done to rosdoc2 to try to preserve the original directory structure as much as possible, in the hopes that relative links would work. But what I recall is that, even after doing that, there was no way to make relative links that worked in both github and rosdoc2. I don't remember the exact issue, but I do recall thinking it might be possible to write a sphinx extension that would solve the problem. Sorry I can't be more specific, maybe next week I can give it a deeper look and see if I cam make any recommendations for your specific situation. |
Thank you for your quick responses and clarification! |
Sorry for the long delay. I got around to testing this today. Here's some some notes for the future. I implemented the changes to full_package above and built. The readme that shows on the main page (which is included from a generated file __readme_include.rst) properly shows the image, and properly links to other documentation. However, the link that appears under "Standard Documents/README) (/full_package/standard_docs/README.html) does not show the image nor the relative link properly. This is because the standard documents have been rewritten to a separate folder, Copying the standard docs to their own folder is useful, because then a simple glob in standards.rst can list the standard documents:
In order to make relative documents work, I would have to copy standard documents to the root of wrapped_sphinx_directory, then manually generate the links in standards.rst rather than relying on a glob. |
Apparently I already did what I suggested above in this unlanded commit I've been a little reluctant to move forward with some of these types of changes because I did not have a good example of an existing repo that would take advantage of this. This issue then helps with the motivation for that commit (and related commits). The resulting display of readme has some issues though, namely that the image is not properly taking up space, so the following text is displayed on top of the image. I suspect that is because I am converting markdown to rst, and there is an issue in upstream dependencies. Anyway I'll face that when I try to land it. |
Thank you for taking a look at the issue! In the meantime I added the package to the ROS index, see rolling version. Apparently, the build farm does something different I assume, because the image is displayed there? |
If I viewed this correctly, it is showing on the home page where it is included with the index.rst, but not in the direct display of the README file from http://docs.ros.org/en/rolling/p/soar_ros/standard_docs/README.html That is the same behavior I described. |
Is this resolved with #171 ? |
A project I am working on, soar_ros, uses its projects README as the main README file in the static HTML documentation generated via rosdoc2 in a CI job. The resulting landing page has the original image links, and file links to related documentation not parsed. For instance, the path when analyzing the HTML image is still
doc/Images/soar_ros_slogan.svg
and the image is not even located in the_images
directory of the output branchgh-pages
.Since this applies to relative links to other files and relative image links, I suspect that paths are not adjusted accordingly/parsed?
Thanks for all your work on the tool and the progress made recently!
The text was updated successfully, but these errors were encountered: