Fortran-FOSS-Programmers / ford

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

How to get extends "links" on doc pages #422

Closed mathomp4 closed 2 years ago

mathomp4 commented 2 years ago

With the help of @ZedThree and a bit of excluding I was able to generate some documentation. Huzzah!

However, I find myself wanting fancier documentation. 😄

Namely, if I look at the docs for GS2 here:

https://gyrokinetics.gitlab.io/gs2/lists/types.html

I see that, say, ballstab_config_type extends abstract_config_type and both of those have links. But in my docs, I only get the link on the first column, but not on the second column. Here's a screenshot (docs only exist on my laptop):

Screen Shot 2022-06-14 at 3 20 24 PM

You can see that AbstractCollectiveDataMessage extends AbstractDataMessage which itself extends AbstractMessage, but I don't have those snazzy links in the second column or in the page for the type itself.

Is there perhaps an option I need to pass to FORD? I tried looking at the project file options, but nothing seems to stand out to my reading. I even found what I think is GS2's configuration file and while I don't understand every option, nothing seems obvious.

Any ideas?

haraldkl commented 2 years ago

It should actually work. See for example https://geb.inf.tu-dresden.de/doxy/musubi/lists/types.html, though that is a little special, as it points to an external project, and links there. However, I believe for the sample in test_data/external_project/external_project it also works and produces a link. Which version are on?

All Types – Musubi
A multi-level parallel lattice Boltzmann solver within the APES suite.
mathomp4 commented 2 years ago

@haraldkl Yeah. I'm a bit baffled. But @ZedThree in https://github.com/Fortran-FOSS-Programmers/ford/issues/421#issuecomment-1156217398 did find that we might be having side-effects due to (at least) preprocessing issues. It's entirely possible the missing links are due to that? Not sure, but once I do more clean up, maybe it'll magically fix? We shall see...

mathomp4 commented 2 years ago

Per the suggestion of @ZedThree in #421, I managed to fix all the "warning redefines" and other warnings I was getting with some code changes. And while it helped GNU cpp run and generate docs, it didn't seem to help with this issue. I still don't have the links.

Well...almost. It turns out I didn't look hard enough. I have exactly one link far down on the page to BaseProfiler:

Screen Shot 2022-06-15 at 9 14 01 AM

And if I go into MemoryProfiler, the link carries on:

Screen Shot 2022-06-15 at 9 20 43 AM

The question is: why does FORD only do this for one type? Every other extended type doesn't get it. BaseProfiler yes, BaseServer no. There are about 700 types on this page and probably 1/4 or more extend something, so it would be nice to figure this out.

ZedThree commented 2 years ago

I think #425 fixes this. Could you try the latest master and see if it works for you?

mathomp4 commented 2 years ago

I think #425 fixes this. Could you try the latest master and see if it works for you?

I'll give it a whirl! I've never built anything from brew with --HEAD...time to learn! :)

mathomp4 commented 2 years ago

I think #425 fixes this. Could you try the latest master and see if it works for you?

Woo hoo! It does! Thanks!

I guess the next thing for me (other than actually documenting the code 😄 ) is to figure out how to tune the graph generation. I tried these settings (based on stdlib):

graph: true
coloured_edges: true
graph_maxdepth: 5
graph_maxnodes: 250

and, well, it took over 3 hours to generate the documentation compared to ~10 minutes without the graphs. Maybe doc generation will be done at night... 😆

mathomp4 commented 2 years ago

Oh. I guess I can close this too.

haraldkl commented 2 years ago

We use

graph_maxdepth: 4
graph_maxnodes: 32

In the project I linked earlier. That works quite nicely. Graphs with many more nodes anyway are hard to understand.