Fortran-FOSS-Programmers / ford

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

Broken links in description on lists pages #612

Closed amorison closed 7 months ago

amorison commented 7 months ago

Some parts of the documentation appear in several locations, notably in descriptions columns of list pages. It seems however that relative links are only built with respect to one location, resulting in potentially broken links. The following minimal example reproduces the issue: ford_rel_link_bug.zip

Subroutines hello_a and hello_b both have a link to the other in their documentation. These links are correct in their own documentation page, e.g. /proc/hello_a.html links tohello_b.html which resolves to /proc/hello_b.html. But on the page listing procedures /lists/procedures.html, the link in the "description" column is also to hello_b.html instead of ../proc/hello_b.html and therefore incorrectly points to /lists/hello_b.html which doesn't exist.

Similar issues arise when e.g. two types refer to one another in their description, and any part of the documentation that can appear in more than one place is potentially affected by this issue.

ZedThree commented 7 months ago

This was because the entity summary is reused as-is between the main entity page and the list pages, so we actually need to make a relative link that works on both. Luckily both pages are the same level of nesting in the directory structure so this wasn't too difficult. I'm pretty sure the summary doesn't appear on any other page, so this should hopefully be ok!