I think it would be interesting to have a thread where people share their knowledge about using FORD. Until now, I had two projects with a FORD documentation but the main steps were carried out by collaborators. After studying it, I have now succeeded in creating FORD documentations in two other projects, following those steps:
-
Creating a
ford.yml
project file at the root of the project. The easiest way is to copy a file from another project, study it with the official doc, and make changes according to your needs. -
The following step is facultative if your objective is to generate your doc using a GitHub workflow, but installing FORD locally can be useful for testing. I have used pipx in Ubuntu 24.04:
$ sudo apt install pipx
$ pipx install ford
$ pipx install pcpp
- Generating your doc directory is as simple as
$ ford ford.yml
-
You can create a file
./github/workflows/ford.yml
. Once again, the easiest way is to copy a file from another project, study it with the official doc, and make changes according to your needs. -
Commit and push the two files.
- Wait for the end of the workflow. A
gh-pages
branch has been created by the workflow.
- Wait for the end of the workflow. A
-
In your GitHub page, go in Settings > Pages
- Choose the branch
gh-pages
and save.
- Choose the branch
-
In the settings of the “About” box of your GitHub project, check the box “Use your GitHub Pages website” to make the .github.io/ link appear.
-
You can now add FORD comments into your Fortran code, using
!!
(following the Fortran code) or!>
(preceding your code). Commit and push…
The whole process is neither complicated nor simple. But once you know what to do, it can be done in 10 minutes.
As a beginner concerning FORD and workflows, I hope to learn more with your comments.