Skip to content

Commit

Permalink
fix docpy
Browse files Browse the repository at this point in the history
  • Loading branch information
mursalatul committed Jan 23, 2024
1 parent 5c22a7a commit 88b9506
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/update_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- name: Run ADMIN/MAINTAIN/UPDATE_DOC.py
run: python ADMIN/MAINTAIN/UPDATE_DOC.py

- name: Check if CONTENT/DOCUMENTATION.md is changed
- name: Check if DOCUMENTATION.md is changed
id: check_changes
run: |
git diff --exit-code --quiet || echo "CONTENT/DOCUMENTATION.md has changes"
git diff --exit-code --quiet || echo "DOCUMENTATION.md has changes"
- name: Commit and push changes
if: steps.check_changes.outputs.result == 'DOCUMENTATION.md has changes'
Expand Down
15 changes: 15 additions & 0 deletions ADMIN/MAINTAIN/DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Code Park Documentation
This documentation provides a front view of the content presented in the repository. Here, you can see the folders and the files with a tree-view structure.

## Content
- [hello_diu](/hello_diu)
- [hello_diu.c](/hello_diu.c)
- [palindrom](/palindrom)
- [is_palindrom_number.c](/is_palindrom_number.c)
- [prime](/prime)
- [is_prime.cpp](/is_prime.cpp)
- [search](/search)
- [binary_search.cpp](/binary_search.cpp)
- [linear_search.cpp](/linear_search.cpp)
- [selection_sort](/selection_sort)
- [selection_sort_cpp.cpp](/selection_sort_cpp.cpp)
6 changes: 3 additions & 3 deletions ADMIN/MAINTAIN/UPDATE_DOC.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
def main():
# getting repository location
cwd = os.getcwd()
cwd = os.path.abspath(os.path.join(cwd, "..", ".."))
cwd = os.path.abspath(os.path.join(cwd, "..", "..")) # change cwd to repo home

# getting file data
ff = Files()
data = (ff.get_all_valid_folder_files_dict(cwd))
print(data)
# print(data)

# writing to Documentation.md
doc = CreateDocumentation()
doc.writedoc(data, cwd)
doc.writedoc(data) # documentation will be written in the repo home

if __name__ == '__main__':
main()
7 changes: 3 additions & 4 deletions ADMIN/MAINTAIN/classes/Documentation.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import os

class CreateDocumentation:
def writedoc(self, folder_file: dict, repository_location):
documentation_path = os.path.join(repository_location, "CONTENT/DOCUMENTATION.md")

with open(documentation_path, "w") as doc:
def writedoc(self, folder_file: dict):

with open("DOCUMENTATION.md", "w") as doc:
doc.write("# Code Park Documentation\n\
This documentation provides a front view of the content presented in the repository. Here, you can see the folders and the files with a tree-view structure.\n\n")

Expand Down

0 comments on commit 88b9506

Please sign in to comment.