Skip to content
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

make detailed readme #1

Open
balotofi opened this issue Mar 28, 2024 · 0 comments
Open

make detailed readme #1

balotofi opened this issue Mar 28, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@balotofi
Copy link
Member

balotofi commented Mar 28, 2024

create a visualisation of organisational structure of this repo similar to the one here

https://github.com/BIRDSOpenSource/BIRDS3-ProceduresAndReports

and add to the Organisation Structure section

my method is a bit long, maybe you can find an alternative

  1. install trees in your cli
  2. type the following command to print a list of the files in the repo gh api '/repos/BIRDSOpenSource/BIRDS3-COM/git/trees/main?recursive=true' -q '.tree[]|.path'
  3. copy list into a blank txt file and save
  4. use this python code to display the visualisation of the files
import os

# Read paths from a file
with open('b3prpaths.txt', 'r') as f:
    paths = [line.strip() for line in f.readlines()]


# Sample list of paths (replace this with the output from your command)
# paths = [
#     "src/main/java/com/example/App.java",
#     "src/main/resources/config.yml",
#     "src/test/java/com/example/AppTest.java",
#     "docs/README.md",
#     "docs/INSTALL.md"
# ]

def build_tree(paths):
    tree = {}
    for path in paths:
        parts = path.split('/')
        current = tree
        for part in parts:
            if part not in current:
                current[part] = {}
            current = current[part]
    return tree

def print_tree(tree, prefix=''):
    keys = sorted(tree.keys())
    for index, key in enumerate(keys):
        if index == len(keys) - 1:
            print(prefix + '└── ' + key)
            new_prefix = prefix + '    '
        else:
            print(prefix + '├── ' + key)
            new_prefix = prefix + '│   '
        print_tree(tree[key], new_prefix)

# Build the tree from paths
tree = build_tree(paths)

# Print the tree
print_tree(tree)
  1. copy the results on the CLI and paste in the Organisational structure section (remove specific files, the tree should only show folder levels)
@balotofi balotofi added documentation Improvements or additions to documentation good first issue Good for newcomers labels Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant