-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extraction of the demo programs from the specs #662
Conversation
The intrinsics descriptions follow a simple pattern (example program starts with "program demo_$TOPIC" and ends with "end demo_$TOPIC") for a similar purpose (as well as do almost all my own repositories). I am interested in what develops and how it is implemented, as I have found that type of approach useful. fpm(1) is still lacking any supported documentation approach other than that ford(1) seems to be used frequently. Wondering if something might emerge that could be used by all the projects, like an option for ford(1) that could automatically generate man-pages as well as extract demo pages from source code and place them in the fpm example page if certain conventions are used. That is, place the documentation for a routine in the source code, and when ford(1) is run (or some simpler fpm-supported preprocessor) you would get the ford documentation, man-pages as real man-pages and as separate (HTML, LaTex, markdown, ...?) documents and any demo program in the documentation would be extracted and show in the ford(1) listing and in the example/ directory of fpm? So if you follow some ford-like convention that has a man-page style using simple plain text in your source code
|
CMakeLists.txt
Outdated
@@ -68,6 +68,8 @@ endif() | |||
|
|||
add_subdirectory(src) | |||
|
|||
add_subdirectory(test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put this under just example
. Fpm can pick up demo programs and run them as well, means we have to deploy this directory with fpm (maybe for a follow-up PR).
Co-authored-by: Ian Giestas Pauli <[email protected]>
It seems it is possible to create a custom target (let's say I don't know if it's applicable to stdlib.
I guess moving it into |
I am not aware of that option. I will look at it. Thanks.
Indeed, |
Let's not create a custom target for this purpose. Instead prefix the test names and use |
@awvwgk This sounds a good idea. But I am not sure how to organize that. Any hints? |
@fortran-lang/stdlib This PR is ready for reviewing and merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM I've tested with both cmake
and fpm
(in which seems there is no way to run all of them at once AFAIK you need to provide a name).
Maybe it is worth mentioning in the README how to run only the examples.
Thank you. I just added instructions to run the examples with |
@14NGiestas @awvwgk I moved the directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. One step closer to fpm-ization of fortran & stdlib.
Thank you for the review. I will merge this PR. |
This PR proposes to create small demo programs of the different features and to include them in the specs through the statement
include
inford
.The main advantage is that the demo programs can be compiled and tested.
Using a small Fortran program, I extracted all demo programs from the specs, and generated small files for each of them. By doing that, I noticed that most of them still contained typos, missing statements, undeclared variables, ... I fixed most of them but still a few demo programs must be fixed.
So, the main advantage of this approach is that all demo programs that will be shown in the specs can be compiled (an issue that has been often mentioned).
Questions:
test/examples
)?TO DO:
ford
fpm