-
Notifications
You must be signed in to change notification settings - Fork 8
Add Complete Tutorials #53
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
Conversation
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.
Thank your for this PR, @rajkumardongre, great progress.
Only tiny formatting nit-picks for now:
- tuotrial.md -> tutorial.md
- Don't bold the text in the headings
- real_proj -> I suggest just "mini-project" or "example-project"
I will take some time to go through the tutorial and test that everything works.
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. It is easy to follow and repeat.
fpm build | ||
``` | ||
|
||
### **Step 5: Import the Libraries** |
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.
### **Step 5: Import the Libraries** | |
### **Step 4: Import the Libraries** |
|
||
* `to_string` : We use this function to convert integers to their string representations | ||
|
||
### **Step 6: Create the `print_org_repositories` Subroutine** |
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.
### **Step 6: Create the `print_org_repositories` Subroutine** | |
### **Step 5: Create the `print_org_repositories` Subroutine** |
README.md
Outdated
|
||
* **[foropenai](https://github.com/gha3mi/foropenai):** A Fortran library for OpenAI API. | ||
|
||
*~By [AliG (gha3mi)](https://github.com/gha3mi)* |
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.
What does this library?
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.
The primary purpose of this project is to facilitate interaction with the OpenAI API. To achieve this, the project is using http
package for making API calls.
|
||
# **Prerequisite** 🚩 | ||
|
||
Before building the GitHub Organization Analyzer library and running the program, you need to ensure that you have [`fpm`](https://fpm.fortran-lang.org/) (Fortran Package Manager) installed. Additionally, there is one dependency required for the [`http-client`](https://github.com/fortran-lang/http-client) library used in the project. Follow the steps below to set up your environment: |
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.
Mention the minimum version of fpm
also here.
|
||
### **Step 2: Install libcurl Development Headers** | ||
|
||
The `http-client` library, requires the libcurl development headers to be installed. On Ubuntu-based systems, you can install the required dependencies using the following command: |
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.
The `http-client` library, requires the libcurl development headers to be installed. On Ubuntu-based systems, you can install the required dependencies using the following command: | |
The `http-client` library requires the libcurl development headers to be installed. On Ubuntu-based systems, you can install the required dependencies using the following command: |
|
||
### **Step 2: Install libcurl Development Headers** | ||
|
||
The `http-client` library, requires the libcurl development headers to be installed. On Ubuntu-based systems, you can install the required dependencies using the following command: |
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.
Maybe:
The `http-client` library, requires the libcurl development headers to be installed. On Ubuntu-based systems, you can install the required dependencies using the following command: | |
The `http-client` library, requires the ``libcurl`` development headers to be installed. On Ubuntu-based systems, you can install the required dependencies using the following command: |
?
|
||
1. Open your terminal or command prompt and create a new directory for the project: | ||
|
||
``` |
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.
``` | |
```bash |
??
### **Step 3: Build the Project** | ||
|
||
Run the following command to build the project: | ||
|
||
``` | ||
fpm build | ||
``` |
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.
Is this step really needed here?
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.
In my understanding, when executing the fpm run
command, the project will be built automatically during that process. Therefore, it seems unnecessary to include a separate step for building the project. So Should I remove this step?
call json%get('['//count//'].name', value, found) | ||
|
||
! Enter the loop to traverse all repositories while they exist | ||
do while(found) |
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.
This loop is strange. Does it call twice json%get
for the same count? Why is the last json%get
needed?
! Traverse Repositories and Print Names | ||
|
||
! Counter to traverse all repos one by one | ||
i = 1 | ||
|
||
! Storing the string equivalent of i in the count variable | ||
count = to_string(i) | ||
|
||
! Fetching the name of the 1st GitHub repository, if it exists (found is set to true) | ||
call json%get('['//count//'].name', value, found) | ||
|
||
! Enter the loop to traverse all repositories while they exist | ||
do while(found) | ||
|
||
! Fetch the name of the current repository (based on the `i` counter) and check if it exists | ||
call json%get('['//count//'].name', value, found) | ||
|
||
! If the repository name exists (`found` is true), print the repository number and name | ||
if (found) then | ||
print *, count//'. ', value | ||
end if | ||
|
||
! Increment the counter for the next repository | ||
i = i + 1 | ||
|
||
! Convert the updated counter to its string representation and store it in count variable | ||
count = to_string(i) | ||
|
||
! Fetch the name of the next repository (based on the updated `i` counter) and update `found` accordingly | ||
call json%get('['//count//'].name', value, found) | ||
|
||
end do |
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.
Here is a suggestion (with a single call to json%get
) that looks easier to understand (at least to me):
! Traverse Repositories and Print Names | |
! Counter to traverse all repos one by one | |
i = 1 | |
! Storing the string equivalent of i in the count variable | |
count = to_string(i) | |
! Fetching the name of the 1st GitHub repository, if it exists (found is set to true) | |
call json%get('['//count//'].name', value, found) | |
! Enter the loop to traverse all repositories while they exist | |
do while(found) | |
! Fetch the name of the current repository (based on the `i` counter) and check if it exists | |
call json%get('['//count//'].name', value, found) | |
! If the repository name exists (`found` is true), print the repository number and name | |
if (found) then | |
print *, count//'. ', value | |
end if | |
! Increment the counter for the next repository | |
i = i + 1 | |
! Convert the updated counter to its string representation and store it in count variable | |
count = to_string(i) | |
! Fetch the name of the next repository (based on the updated `i` counter) and update `found` accordingly | |
call json%get('['//count//'].name', value, found) | |
end do | |
! Traverse Repositories and Print Names | |
! Counter to traverse all repos one by one | |
i = 0 | |
! Enter the loop to traverse all repositories while they exist | |
do | |
! Increment the counter for the next repository | |
i = i + 1 | |
! Convert the updated counter to its string representation and store it in count variable | |
count = to_string(i) | |
! Fetch the name of the current repository (based on the `i` counter) and check if it exists | |
call json%get('['//count//'].name', value, found) | |
if(.not.found) exit | |
! If the repository name exists (`found` is true), print the repository number and name | |
print *, count//'. ', value | |
end do |
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.
Thanks, @jvdp1 now it's more readable
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.
Examples of command-line input should probably start with a dollar sign to make it more obvious, i.e.,
$ sudo apt install -y libcurl4-openssl-dev
Instead of:
sudo apt install -y libcurl4-openssl-dev
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.
I see your point, but one issue with that is that commands like this are likely to be copied to clipboard, which when pasted includes the "$" which breaks the command. So I think it's better to leave it out.
README.md
Outdated
*~By [Rajkumar Dongre (rajkumardongre)](https://github.com/rajkumardongre)* | ||
* **[fortran-xkcd](https://github.com/rajkumardongre/fortran-xkcd/tree/http_client_version):** An fpm example project written in Fortran 2018 that displays the latest xkcd comic inside an X window. As a limitation, only images in PNG format are supported (no JPEG). The alt text will be printed to console. | ||
|
||
*~By [Philipp (interkosmos)](https://github.com/interkosmos)* | ||
|
||
* **[foropenai](https://github.com/gha3mi/foropenai):** A Fortran library for OpenAI API. | ||
|
||
*~By [AliG (gha3mi)](https://github.com/gha3mi)* |
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.
I think these "By author name" attributions are redundant, since you already link to the project GitHub repos, it's obvious who their authors are.
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.
I see your point, but one issue with that is that commands like this are likely to be copied to clipboard, which when pasted includes the "$" which breaks the command. So I think it's better to leave it out.
README.md
Outdated
## Getting Started Guides 👋 | ||
|
||
|
||
### Table of contents: |
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.
Rather than having the tutorial TOC here, why not put it on top of tutorial.md? It seems more appropriate that a TOC for a doc would be in that doc, not outside of it. Here in the README you can just link to the tutorial doc.
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.
Thank you for the great work, @rajkumardongre, I'll merge it.
No description provided.