-
Notifications
You must be signed in to change notification settings - Fork 5
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 link handling for README inclusion #131
Comments
MyST includes a |
This is still possible in MyST, but the syntax is different. E.g. for scanspec in the README we have: ![plot][] at the bottom of the README we have the link on GitHub: [plot]: https://raw.githubusercontent.com/dls-controls/scanspec/master/docs/images/plot_spec.png Then in the docs/index.md it gets overridden: [plot]: images/plot_spec.png Does this work for you? If so, please could we have a docs article on <img src="https://raw.githubusercontent.com/dls-controls/scanspec/main/docs/images/scanspec-logo.svg"
style="background: none" width="120px" height="120px" align="right"> |
Unfortunately whatever you put in the README also has to work on PyPI, and I don't think relative images work there. I could be wrong though... |
Thanks for the comments and examples. The E.g
So I think the README would still work as expected on GitHub. However I have just noticed that even with the current RST README in blueapi, the image doesn't appear on PyPI so perhaps using the raw gh content url is the only reasonable working solution. Is it worth considering to use absolute commit references to ensure that e.g. images included in releases will not change over time or is it not worth the maintenance cost? I imagine it might be a bit of a pain. E.g:
or:
instead of:
|
Yeah, it probably makes sense to do that despite the pain... |
I'll assign this to me as a reminder to add some documentation as suggested. |
The how-to has been added (#142 ) so I think this can be closed now. |
In the docs build the index page includes the top level project README.md. This can cause issues if the README includes images or links to things relative to the top level of the repository.
For example something such as:
This causes the Sphinx build to fail as it is resolving things relative to the
docs
directory. This is probably due to sphinx-doc/sphinx#701.In the previous rst docs this was worked around by redefining the reference in the docs build i.e.
then included in the Sphinx pages with:
Workarounds
eval-rst
might work for the Sphinx build but probably not with the GitHub markdown renderingmain
branch which could change (or be removed) over timeThe text was updated successfully, but these errors were encountered: