Skip to content

make detailed readme #1

Description

@balotofi

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions