I'm writing some docs for Sphinx/rst. How can I link to something on local disk which is relative to the page you're viewing?
For example:
====================
My App documentation
====================
The official My App documentation can be found here:
https://myapp.com/docs
A local mirror is available:
../../_static/docs_mirror/index.html
On my machine, the _static folder resides in:
file:///Users/fredrik/code/repos/myapp/docs/_static
...but I don't want to hard-code that path, as that path might not be the same path for another user who has downloaded cloned the repository.
ext. intersphinx – Link to other projects' documentation. New in version 0.5. This extension can generate links to the documentation of objects in external projects, either explicitly through the external role, or as a fallback resolution for any other cross-reference.
Here is one way to do it:
`local mirror <_static/docs_mirror/index.html>`_
Another option:
`local mirror`_
.. _local mirror: _static/docs_mirror/index.html
Reference: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#hyperlink-references.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With