From 03372e09df04a2b3364cb1e761b1ccdeaa2a448a Mon Sep 17 00:00:00 2001 From: Kirill Markin Date: Sun, 9 Jun 2024 10:27:48 +0200 Subject: [PATCH] settings example in README --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c548b08..044be3c 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,46 @@ To uninstall the package, run the following command from the directory where the pip uninstall repo-to-text ``` +## Settings + +`repo-to-text` also supports configuration via a `.repo-to-text-settings.yaml` file. By default, the tool works without this file, but you can use it to customize what gets included in the final text file. + +### Creating the Settings File + +To create a settings file, add a file named `.repo-to-text-settings.yaml` at the root of your project with the following content: + +```yaml +# Syntax: gitignore rules + +# Ignore files and directories for all sections from gitignore file +# Default: True +gitignore-import-and-ignore: True + +# Ignore files and directories for tree +# and "Contents of ..." sections +ignore-tree-and-content: + - ".repo-to-text-settings.yaml" + - "examples/" + - "MANIFEST.in" + - "setup.py" + +# Ignore files and directories for "Contents of ..." section +ignore-content: + - "README.md" + - "LICENSE" + - "tests/" +``` + +You can copy this file from the [existing example in the project](https://github.com/kirill-markin/repo-to-text/blob/main/.repo-to-text-settings.yaml) and adjust it to your needs. This file allows you to specify rules for what should be ignored when creating the text representation of the repository. + +### Configuration Options + +- **gitignore-import-and-ignore**: Ignore files and directories specified in `.gitignore` for all sections. +- **ignore-tree-and-content**: Ignore files and directories for the tree and "Contents of ..." sections. +- **ignore-content**: Ignore files and directories only for the "Contents of ..." section. + +Using these settings, you can control which files and directories are included or excluded from the final text file. + ## Contributing Contributions are welcome! If you have any suggestions or find a bug, please open an issue or submit a pull request. diff --git a/setup.py b/setup.py index 428038d..863b8ba 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('requirements.txt') as f: setup( name='repo-to-text', - version='0.2.0', + version='0.2.1', author='Kirill Markin', author_email='markinkirill@gmail.com', description='Convert a directory structure and its contents into a single text file, including the tree output and file contents in markdown code blocks. It may be useful to chat with LLM about your code.',