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

Directory tree listing #1448

Open
vanillajonathan opened this issue Jun 9, 2023 · 31 comments
Open

Directory tree listing #1448

vanillajonathan opened this issue Jun 9, 2023 · 31 comments
Assignees
Labels
enhancement New feature or request

Comments

@vanillajonathan
Copy link

vanillajonathan commented Jun 9, 2023

Is your feature request related to a problem? Please describe.
I want a directory listing.

Describe the solution you'd like

@startfiles
/.github
/src/example.py
/tests/example_test.py
/README.md
/LICENSE
@endfiles

PlantUML should render this prettily!

📁 .github
📂 src/
   📄 example.py
📂 tests/
   📄 example_test.py
📄 README.md
📄 LICENSE

or:

├── .github
├── src
│   ├── example.py
├── tests
│   ├── example_test.py
├── README.md
└── LICENSE
@github-actions github-actions bot added the triage label Jun 9, 2023
@vanillajonathan vanillajonathan changed the title Directory listing Directory tree listing Jun 9, 2023
@arnaudroques arnaudroques added enhancement New feature or request and removed triage labels Jun 9, 2023
@arnaudroques arnaudroques self-assigned this Jun 9, 2023
@arnaudroques
Copy link
Contributor

Sounds like an interesting suggestion... and it should be easy to implement.
We like your first rendering with emoticons.

Before starting, few questions:

  • should we sort file names:
@startfiles
/c
/b
/a
@endfiles
  • How should we render this:
@startfiles
/.github
/src/example1.py
/tests/example_test.py
/src/example2.py
/README.md
/LICENSE
strange_file.txt
@endfiles

@vanillajonathan
Copy link
Author

It probably should not sort the file names, I think it should use the same order as they are written, then it is up to the users to write them in his desired order if he want them sorted or not. On the other hand, maybe the implementation would be easier if it were sorted, then that would be fine too.

I don't know how files or directories that does not start with a slash should be rendered, but I think all files in the same directory should be rendered together in the same directory since directory names must be unique.

@startfiles
/src/example1.py
/tests/example_test.py
/src/example2.py
@endfiles

Would be rendered as:

📂 src/
   📄 example1.py
   📄 example2.py
📂 tests/
   📄 example_test.py

@arnaudroques
Copy link
Contributor

Ok, thanks.

Another simple question:
In your first example:

@startfiles
/.github
/src/example.py
/tests/example_test.py
/README.md
/LICENSE
@endfiles

.github is displayed as a folder. But how do we know that it is a folder and not a simple file?

Maybe we should have:

@startfiles
/.github/
/src/example.py
/tests/example_test.py
/README.md
/LICENSE
@endfiles

Any though?

@vanillajonathan
Copy link
Author

Good point!
Yes, I agree it should end with a slash in order to be rendered as a folder.

There could also be different file icons rendered depending on the file extension.

@arnaudroques
Copy link
Contributor

It's really a pre-alpha version that does not work as specified yet.

But I wanted to let you know that some work have been started.

Thanks for suggestion and stay tuned :-)

@arnaudroques
Copy link
Contributor

We've made some progress :-)

Any though?

Icons are not perfect (especially the colors). Do you know any free svg files we could use for files and folder icons?

@The-Lum
Copy link
Collaborator

The-Lum commented Jun 12, 2023

Here is a possible example:

@vanillajonathan
Copy link
Author

There needs to be some space between the icon and the file name.

Bootstrap icons are available under the MIT License.
https://icons.getbootstrap.com/?q=file-
https://icons.getbootstrap.com/?q=folder-

@jimmyoc001
Copy link

Really love this as I need something like this for my documentation.
do you think it's possible to add notes at some point?
Would be really useful.

arnaudroques added a commit that referenced this issue Jun 27, 2023
@arnaudroques
Copy link
Contributor

So with last snapshot, you can have this:

@startfiles
/.github/
/src/example.py
/src/iiimple1.py
/tests/example_test.py
/src/wwwmple2.py
/tests/v1/example_test.py
/README.md
/doc/foo/dummy.doc
<note>
this is a note
on two lines
</note>
/LICENSE
@endfiles

This is still an early version, we are not satisfied with the syntax.
Any idea is welcome!

@The-Lum
Copy link
Collaborator

The-Lum commented Jun 27, 2023

Hi,

A mean question will be:

  • How to manage alignment: top or bottom?
    And align with the nearest element...

Regards

@vanillajonathan
Copy link
Author

Maybe each file could have a separate comment to the right of the file name.
Example:

@startfiles
/.github  # Contains GitHub-specific files such as CI
/src/example.py
/tests/example_test.py
/README.md  # This is Markdown format
/LICENSE  # Contains the license
@endfiles

@sahyung
Copy link

sahyung commented Aug 10, 2023

is it possible to have multi color folders?
example for this code, the folder foo and v1 has color yellow, and the rest still use blue.

@vanillajonathan
Copy link
Author

Files and folders starting with a dot, example .github (hidden) could be dimmed.

@The-Lum
Copy link
Collaborator

The-Lum commented Aug 11, 2023

@sahyung:

is it possible to have multi color folders?
example for this code, the folder foo and v1 has color yellow, and the rest still use blue.

Good request...

  • Why not by style?
    Using * or descendant selector or depth...

For a new enhancement... (and group of all new wanted features).

Regards,
Th.

@The-Lum
Copy link
Collaborator

The-Lum commented Aug 11, 2023

@vanillajonathan:

Files and folders starting with a dot, example .github (hidden) could be dimmed.

  • Why not also all the corresponding descending elements?

For a new enhancement... (and group of all new wanted features).

Regards,
Th.

@swmatisa
Copy link

Any news?
It would also be nice to be able to style for example

<style> filesDiagram { Linecolor black icon{ BackgroudColor green } :depth(1) { Linecolor Yellow } } </style>

@davide1995
Copy link

davide1995 commented Nov 21, 2023

Looks like if I write following:
/tests/__init__.py
It doesn't render correctly

Screenshot 2023-11-21 at 11 50 43

@The-Lum
Copy link
Collaborator

The-Lum commented Nov 21, 2023

Hi @davide1995, and all,

It is due to the Creole management, see this funny example:

@startfiles
/tests/__init_file__.py
/tests/~__init_file__.py

/**creole_test**/~~wave~~
/**creole_test**/**bold**
/**creole_test**/""monospaced""
/**creole_test**/--stricken-out--
/**creole_test**/__underlined__
/**creole_test**/~__not underlined__
/**creole_test**/~~wave-underlined~~
/**creole_test**///not italics :)//

/**creole_html_test**/<b>bold
/**creole_html_test**/<i>italics
/**creole_html_test**/<font:monospaced>monospaced
/**creole_html_test**/<s>stroked
/**creole_html_test**/<u>underlined
/**creole_html_test**/<w>waved
/**creole_html_test**/<s:green>stroked
/**creole_html_test**/<u:red>underlined
/**creole_html_test**/<w:#0000FF>waved
/**creole_html_test**/<color:blue>Blue
/**creole_html_test**/<back:orange>Orange background
/**creole_html_test**/<size:20>big
@endfiles

Enjoy... :-)
Regards.

@swmatisa
Copy link

Hello,
I also try to put Archimate sprite and it is not working

@arnaudroques
Copy link
Contributor

Funny indeed :-)
However, we have disabled creole in last snapshot for filenames (tell us if you would like to have creole except for underline)
Hope this help!

@The-Lum
Copy link
Collaborator

The-Lum commented Nov 23, 2023

Hi,

Ok: to disable all Creole temporary.

But perhaps it will be interesting to have commands to highlight some folder or file, why not with the HTML creole form (where you are sure that those folder or filename don't include this HTML form inside there names... ).

Regards,
Th.

@vanillajonathan
Copy link
Author

It could even use different icons for different file extensions.

@swmatisa
Copy link

Hi,
If I cannot use Creole, HTML creole will be good. Style and icon use will be alternatives

@swmatisa
Copy link

swmatisa commented Jan 8, 2024

Hi,
Could you please add "common commands" like title, legend, caption, etc. ?

@MySpamKit
Copy link

Hi,
Is there a way to include remarks or notes about a particular file or directory in its vicinity?

@The-Lum
Copy link
Collaborator

The-Lum commented Jan 13, 2024

Hi @MySpamKit

Is there a way to include remarks or notes about a particular file or directory in its vicinity?

Yes, currently only below a file (not for directory) you can see this:

Regards,
Th.

@MySpamKit
Copy link

Thank you :-)

@dgrigonis
Copy link

dgrigonis commented Feb 18, 2024

To me what would be useful is to be able to connect individual tree entries to other graphs. Specifically, adding this dimension to component diagrams to see how application fits into filesystem is what I am trying to do now.

map {} seems to fit ok for this purpose, except can't find how to align key text.

@AlexCzar
Copy link

Are themes not supported?
I'm using plantuml-asl-1.2024.3
and

!theme crt-amber from https://raw.githubusercontent.com/plantuml/plantuml/master/themes

other diagrams are rendered in the specified theme, but if I try to do the same with directory listing, it's white background, blue folders, gray files.

@The-Lum
Copy link
Collaborator

The-Lum commented Feb 29, 2024

Hello @AlexCzar,

[Just for traceability]
You are right, that is not yet implemented, as for regex:

Awaiting style improvement,
Regards,
Th.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants