了解任何项目的结构

问题描述 投票:0回答:4

我已经在自述文件中看到了项目结构,我如何才能获得我的项目(任何程序)的这种结构?任何网站。我觉得手工创建不合适吗?

structure
4个回答
1
投票

是的,有一个非常简单的方法来获取它。

导航到项目的根文件夹并从终端运行

tree
。你应该得到这样的东西:

project_root
│   README.md    
│
└───some_folder
│   │   another_file.txt
│   │   some_code.code
│   │
│   └───some_subfolder
│       │   some_more_code.txt
│       │   another_file.txt
│       │   a_picture.png
│       │   ...
│   
└───another_folder
    │   more_files.txt
    │   more_code.code
    ...

现在您可以将此树复制并粘贴到您的自述文件中,用三个反引号 - ``` 括起来以获得 Markdown 样式。


0
投票

https://ascii-tree-generator.com/ --> 手动 *** 或者 *** powershell 中的树命令 --> auto


0
投票

对于你的情况我会这样做:

  1. 转到您想要树根的目录
  2. 运行命令
    tree -d > my_tree_structure.txt

注意:您可以使用

tree -d -L <level>
限制树的深度。仅对于根目录及其子目录,您将使用
tree -d -L 2


0
投票

我有这个问题很长时间了,我尝试了多种类型的树模块,但没有按照我想要的方式工作,但在这里我为树 dir-tree 制作了一个 python 模型

运行这个:

pip install dir-tree-drh
阅读https://github.com/dragon-devs/dir-tree-drh上的阅读文档。

如果对你有帮助就给个star吧

© www.soinside.com 2019 - 2024. All rights reserved.