0.0
The project is in a healthy, maintained state
MarkdownTree is designed for developers and teams who need a simple and flexible way to document the structure of their projects. Whether you are preparing a README, documenting a codebase, or generating a project overview, MarkdownTree allows you to create a clear and organized representation of your directory structure in Markdown format. With MarkdownTree, you can: - Exclude specific folders or files from the generated structure. - Define the root directory from which to start generating the structure. - Customize the output file name to fit your documentation standards. MarkdownTree integrates seamlessly with Rails and other Ruby applications, offering an initializer for easy configuration. It is a valuable tool for maintaining clear and up-to-date project documentation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

MarkdownTree

MarkdownTree is a Ruby gem that generates a directory structure in Markdown format. It is highly configurable, allowing you to exclude specific folders, choose the root directory, and specify the output file name.

Installation

You can install the gem and add it to your application's Gemfile by executing:

bundle add markdown_tree

If bundler is not being used to manage dependencies, install the gem by executing:

gem install markdown_tree

Usage

Basic Example

To generate the directory structure in Markdown format from the current directory, simply call the generate_tree method:

require 'markdown_tree'

MarkdownTree.generate_tree

Excluding Specific Folders

You can configure which folders to exclude from the generated structure:

MarkdownTree.configure do |config|
  config.exclude_list = ['node_modules', '.git', 'tmp']
end

MarkdownTree.generate_tree

Selecting the Root Directory

You can also specify the directory from which you want to generate the structure:

MarkdownTree.configure do |config|
  config.root_directory = '/path/to/your/directory'
end

MarkdownTree.generate_tree

Customizing the Output File Name

You can set the name of the file where the directory structure will be saved:

MarkdownTree.configure do |config|
  config.output_file = 'custom_directory_structure.md'
end

MarkdownTree.generate_tree

Full Configuration Example in Rails

If you're using Rails, you can configure all these options in an initializer:

# config/initializers/markdown_tree.rb
MarkdownTree.configure do |config|
  config.exclude_list = ['node_modules', '.git', 'tmp']  # Directories to exclude
  config.root_directory = Rails.root.join('app').to_s     # Root directory to start generating structure
  config.output_file = 'custom_directory_structure.md'    # Output file name
end

Contributing

Contribution directions go here. You can fork the repository, create a new branch, and submit a pull request for review. Please make sure to write tests for your contributions and follow the coding standards set in the project.

License

The gem is available as open source under the terms of the MIT License.