idea项目结构树状展示_Wispha -- 轻松展示项目结构布局

GitHub仓库:Evian-Zhang/Wispha

随着越来越多的项目开源,我们可以接触到许多大型的、复杂的项目。这些项目可能会有成百上千个文件、目录。但是,许多项目对于这些文件和目录并没有详细的说明,让我们阅读源码很困难。而那些有详细说明的项目,其展示这些说明的方法也并不统一。因此,我用Rust写了这个工具,希望用这一工具来改善这一现状。

废话不多说,让我们看看它的实际效果吧!

首先,我们将该项目的源代码克隆至本地

git clone https://www.github.com/Evian-Zhang/Wispha

然后在目录wispha下,如果我们已经安装了wispha这一工具,则直接使用

wispha layout --project-name Wispha --keys description --hide-key 

然后就可以看到该项目的布局啦!

Wispha                        Wispha project main folder
├── libwispha                 Wispha library used by binary wispha
│   ├── src                   Source code of library wispha.
│   │   ├── lib.rs            Entry point for the library
│   │   ├── core.rs           Define core structs
│   │   ├── strings.rs        Consists of static str used by library
│   │   ├── manipulator.rs    APIs for node manipulation
│   │   └── serde             APIs for serialization and deserialization
│   ├── tests                 integration tests
│   │   ├── ser_test          tests for serialization
│   │   └── de_test           tests for deserialization
│   ├── Cargo.toml            Manifest file for cargo to run
│   ├── LICENSE-MIT           MIT license
│   └── LICENSE-APACHE        Apache license version 2.0
├── src                       Source code of binary executable wispha.
│   ├── main.rs               Entry point of binary
│   ├── layouter.rs           Define the `Layout` trait for templates
│   ├── layout_templates      Templates that implements `Layout` trait
│   │   ├── mod.rs            
│   │   ├── plain.rs          Define the plain layout.
│   │   ├── line.rs           Define the line layout.
│   │   └── triangle.rs       Define the triangle layout.
│   └── commandline           Commandline interface
│       ├── mod.rs            
│       ├── layout.rs         Layout subcommand
│       └── interact          Interact subcommand
├── Cargo.toml                Manifest file for cargo to run
├── README.md                 
├── README-zh-CN.md           Simplified Chinese version of README
├── LICENSE-MIT               MIT license
├── LICENSE-APACHE            Apache license version 2.0
└── .travis.yml               File for Travis CI to run

由于该项目是用Rust编写,所以在高性能的同时,也不用担心平台问题。目前我打包了Windows, macOS和Debian/Ubuntu版本的包,大家也可以直接从源码编译。

这个命令行工具最主要的特点,是在展示项目结构的基础上,可以直观地反应每个文件/目录的说明,同时也可以自定义展示的内容。希望大家可以尝试一下,也欢迎大家提issue和pull request.