Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markdown_tree

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown_tree

  • 0.1.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 28 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc