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 file tree diagrams uniform and scripted? #1263

Open
gcapes opened this issue Nov 17, 2021 · 3 comments
Open

Make file tree diagrams uniform and scripted? #1263

gcapes opened this issue Nov 17, 2021 · 3 comments
Labels
help wanted Looking for Contributors type:discussion Discussion or feedback about the lesson type:enhancement Propose enhancement to the lesson

Comments

@gcapes
Copy link
Contributor

gcapes commented Nov 17, 2021

There are various diagrams illustrating a file tree in this lesson. Some in the main body of episode 2 which I guess were manually created, and some in the exercises which look to have been made with graphviz. Ep7 has another of the manually created diagrams. There's nothing wrong with this except when it comes to changing the lesson. It's a pain to manually recreate these drawings and is a barrier to making changes.

I've written some python using graphviz which will create diagrams from a directory tree like this. Interested in adding this to the lesson?
tree-diagram.gv.pdf

@deppen8 deppen8 added help wanted Looking for Contributors type:enhancement Propose enhancement to the lesson labels May 6, 2022
@nbehrnd
Copy link
Contributor

nbehrnd commented May 27, 2022

Depending on the depth to cover, I like to use tree because it discerns folders and files (folders may be disabled by -d) and yields a representation from which one may copy-paste the name of files and folders. It works best if the font is non-proportional.

For an illustration, the shell-lesson-data (fetched from here) were decompressed to the desktop. As an example to reach two levels deep (-L 2):

~/Desktop/shell-lesson-data$ tree -L 2 -d
.
├── exercise-data
│   ├── animal-counts
│   ├── creatures
│   ├── proteins
│   └── writing
└── north-pacific-gyre

6 directories

Or one providing a quick report for files and folders:

~/Desktop/shell-lesson-data$ tree exercise-data/
exercise-data/
├── animal-counts
│   └── animals.csv
├── creatures
│   ├── basilisk.dat
│   ├── minotaur.dat
│   └── unicorn.dat
├── numbers.txt
├── proteins
│   ├── cubane.pdb
│   ├── ethane.pdb
│   ├── methane.pdb
│   ├── octane.pdb
│   ├── pentane.pdb
│   └── propane.pdb
└── writing
    ├── haiku.txt
    └── LittleWomen.txt

4 directories, 13 files

@gcapes gcapes added the type:discussion Discussion or feedback about the lesson label Jun 6, 2022
@gcapes
Copy link
Contributor Author

gcapes commented Jun 6, 2022

tree certainly makes it easy to create the representations and is already used in various places in the lesson, but maybe isn't suitable to replace all the graphical representations which are probably useful representations for many novices.

@braunms
Copy link

braunms commented Jul 7, 2022

I like the idea of generating the file structure diagrams via a script. Alternatively, I would like to suggest draw.io (https://app.diagrams.net/) In my opinion it is a very intuitive web-based tool for creating nice diagrams very fast. The project file can be stored inside the png file header. This way, the png file can be taken to reload the project in draw.io

tree-diagram draw io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Looking for Contributors type:discussion Discussion or feedback about the lesson type:enhancement Propose enhancement to the lesson
Projects
None yet
Development

No branches or pull requests

4 participants