caarlos0 / mdtree

Convert markdown lists into ASCII trees
MIT License
49 stars 0 forks source link

Feature Requests: Adding a Config File #2

Open roelvangils opened 2 weeks ago

roelvangils commented 2 weeks ago

As a user of mdtree, I think it would be cool to be able to create a configuration file in my home folder that allows me to specify color settings. For example, the file could be placed at ~/.config/mdtree/config.json and might look like this:

{
  "colors": {
    "branches": "\u001b[90m",      // Bright black (grey) for the tree branches
    "default": "\u001b[37m",       // White for text
    "blah": "\u001b[32m",          // Green for all items containing the text "blah"
    ".jpg": "\u001b[31m"           // Red for all items containing the text ".jpg" (for example, when using a file list)
  }
}

The idea is to specify a color for the branches of the tree and the default text. Additionally, you can specify colors for text items that match specific text using a regular expression.

What do you think? Would this make sense? 🤔

caarlos0 commented 2 weeks ago

I think so yeah... but I don't have time to work on it right now... if you want to do it and pr it i can squeeze in a review though :)