Fortran-FOSS-Programmers / ford

Automatically generates FORtran Documentation from comments within the code.
https://forddocs.readthedocs.io
GNU General Public License v3.0
405 stars 131 forks source link

`|page|`, `|media|`, and `|url|` are absolute instead of relative #581

Closed amorison closed 8 months ago

amorison commented 10 months ago

When project_url is left blank, internal links should be relative to make it possible to serve the generated documentation with a web server. In particular, this means |page|, |media|, |url| should be relative links instead of absolute paths. PR #562 fixed the problem that |page| and |media| would expand to the wrong relative paths in nested pages, but in doing so made those links fully absolute and resolved instead of relative.

ZedThree commented 10 months ago

Oh dear, I thought I had tried to make it not do that! Will investigate

amorison commented 10 months ago

After running a couple of local tests, it seems link resolution is broken in various ways on Ford 7.0.2. Link to Fortran entities (programs, types, etc) from/to static pages resolve to the wrong location. For example (locally serving the generated documentation on port 8080):

ZedThree commented 10 months ago

Thanks for looking into this @amorison. Would you be able to wrap that up into a minimal self-contained example please? I'm afraid I don't have a great deal of time to spend on Ford at the moment, so this would help me out a lot!

amorison commented 10 months ago

Here is an example that reproduces the issue. Call ford docs.md from the doc subfolder to generate the documentation. Notice how the links from/to static pages are either broken, or absolute instead of relative (which is more apparent when browsing the documentation served with a web browser).

ford_test.tar.gz