Skip to content

First steps towards a useful developer documentation#42

Open
yoricklassmann wants to merge 5 commits into
mainfrom
documentation
Open

First steps towards a useful developer documentation#42
yoricklassmann wants to merge 5 commits into
mainfrom
documentation

Conversation

@yoricklassmann
Copy link
Copy Markdown
Collaborator

@yoricklassmann yoricklassmann commented May 16, 2026

At long last I have found some time to look into #11. It turns out that FORD works out of the box, but produces rather shabby looking documentation and there are a couple of warnings still, that relate to FORD complaining about some DOXYGEN stuff:

Warning: Error parsing src/modules/BundleModule.f90.
        Preceding documentation lines can not be inline:       class(T_TrajectoryBundle), intent(inout) :: B1 !> Bundle

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.90%. Comparing base (86dd529) to head (e8e6fdd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #42      +/-   ##
==========================================
- Coverage   54.08%   53.90%   -0.19%     
==========================================
  Files          41       41              
  Lines        5985     6007      +22     
  Branches      807      810       +3     
==========================================
+ Hits         3237     3238       +1     
- Misses       2399     2419      +20     
- Partials      349      350       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yoricklassmann
Copy link
Copy Markdown
Collaborator Author

Building the docs is straightforward:

  1. Install FORD with your favorite package manager
  2. Execute ford openfms_docs.md

That's it.

@danielhollas
Copy link
Copy Markdown
Member

Thanks for looking into this Yorick!

I'll have a closer look later, but in the meantime, can you please add a new CI job to run Ford build to make sure that the doc building works. You can add a new job to the lint.yml file:

https://github.com/ispg-group/openfms/blob/main/.github%2Fworkflows%2Flint.yml

Also, I noticed that FORD has an option to parse doxygen-style comments. Can you try to enable it and see how it looks like. If we could avoid reformatting all the existing documentation that would be great.

!<

type T_BFlags
! private
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the private statement got deleted here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need it? I would prefer to specify in code that it is private, or leave it out because in the documentation it will show the visibility anyway. I'd prefer the former.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, this should not be part of the current PR, so I've reverted to the original.

Comment thread openfms_docs.md Outdated
@yoricklassmann
Copy link
Copy Markdown
Collaborator Author

Thanks for looking into this Yorick!

I'll have a closer look later, but in the meantime, can you please add a new CI job to run Ford build to make sure that the doc building works. You can add a new job to the lint.yml file:

https://github.com/ispg-group/openfms/blob/main/.github%2Fworkflows%2Flint.yml

Ok will do

Also, I noticed that FORD has an option to parse doxygen-style comments. Can you try to enable it and see how it looks like. If we could avoid reformatting all the existing documentation that would be great.

Yes, that's the case, and generally works quite well, but for some reason the documentation in the example didn't get produced even though FORD can indeed parse doxygen-style comments...

I think what it doesn't like is when you have something like in the TrajectoryModule where variables are just written on one long line, with & line breaks added in the aid of readability. Compare that for example with ElecStrucModule where the variables are separately defined, then FORD produces nice docs.

Copy link
Copy Markdown
Member

@danielhollas danielhollas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently on a Cross country train without good internet so wasn't able to test yet, but have two asks for CI. Can you also please add a short section about how to build and read the docs in the CONTRIBUTING.md guide. Later we can add more about the style guide questions that you raised in the linked GH issue.

Comment thread .github/workflows/lint.yml
Comment thread .github/workflows/lint.yml
Copy link
Copy Markdown
Member

@danielhollas danielhollas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now had a brief time to test this, looks nice!

Sorry for a piecemeal review, there are some more things to tweak.

Also please add short paragraph to CONTRIBUTING.md as noted above.

- uses: actions/upload-artifact@v7
with:
name: Docs artifact
path: ./docs/
Copy link
Copy Markdown
Member

@danielhollas danielhollas May 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So docs directory actually contains the documentation Overleaf. Apparently, FORD uses doc by default, which is confusing. Can you please add the output_dir option to the configuration. I would use developer_docs/, but am open to other suggestions. We should then use this consistently to distinguish it from documentation for users, so e.g. I would rename this CI job to dev-docs-build or something like that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever output directory we decide, we should also add it to .gitignore. Thanks!

Comment on lines +34 to +35
env:
SKIP: 'no-commit-to-branch'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is prek specific

Suggested change
env:
SKIP: 'no-commit-to-branch'

Comment thread openfms_docs.md
protected
---

Test
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's put something here, e.g.

Suggested change
Test
Auto-generated developer documentation for OpenFMS

Comment thread openfms_docs.md
---
project: OpenFMS
preprocessor: gfortran -E
display: private
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's perhaps debatable if we want to include the private stuff. I feel like if I was browsing this autogenerated documentation (instead of reading the source code directly) I would appreciate the more high-level public-only view. But I don't know, I am also fine with including private stuff this in this PR.

Comment thread openfms_docs.md
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename the this file to a more specific name. Maybe ford_config.md?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants