Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/esoltys/repo-documenter
Repo-Documenter is a PowerShell script that generates comprehensive documentation for a repository, including a tree view of the repository structure and the contents of specified files. The aggregated file is useful for code review, documentation, or use by an AI assistant.
https://github.com/esoltys/repo-documenter
code-assistant powershell
Last synced: 26 days ago
JSON representation
Repo-Documenter is a PowerShell script that generates comprehensive documentation for a repository, including a tree view of the repository structure and the contents of specified files. The aggregated file is useful for code review, documentation, or use by an AI assistant.
- Host: GitHub
- URL: https://github.com/esoltys/repo-documenter
- Owner: esoltys
- License: mit
- Created: 2024-08-03T15:57:54.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-05T16:53:39.000Z (3 months ago)
- Last Synced: 2024-10-13T00:01:47.790Z (26 days ago)
- Topics: code-assistant, powershell
- Language: PowerShell
- Homepage:
- Size: 119 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Repo-Documenter
Repo-Documenter is a PowerShell script that generates comprehensive documentation for a repository, including a tree view of the repository structure and the contents of specified files. The aggregated file is useful for code review, documentation, or use by an AI assistant.
![screenshot](screenshot.png)
## Features
- Generates a tree view of the repository structure
- Aggregates content from specified files
- Safely handles binary files by excluding their content
- Outputs a single Markdown file containing the repository documentation
- Configurable via a simple configuration file## Prerequisites
- PowerShell 5.1 or later
## Installation
1. Clone this repository or download the `Repo-Documenter.ps1` script.
2. Ensure that PowerShell execution policy allows running scripts.## Usage
1. Create a `repo_documenter.config` file in the root of the repository you want to document.
2. Add patterns to the `repo_documenter.config` file to specify which files and directories to include.
3. Run the script with the following command:```powershell
.\Repo-Documenter.ps1 -RepoPath [-OutputFile ]
```If no output file is specified, the script will create a Markdown file named after the repository in the current directory.
## Configuration
Create a `repo_documenter.config` file in the root of your repository. Each line in this file should contain a pattern for files or directories to include. For example:
```
*.md
src/*
docs/*.txt
```This configuration will include all Markdown files, everything in the `src` directory, and all text files in the `docs` directory.
## Binary File Handling
The script now safely handles binary files:
- Binary files (e.g., images, executables) are detected automatically.
- Content of binary files is not included in the output to prevent corruption.
- Binary files are listed in the repository structure but marked as binary in the file contents section.## Output
The script generates a Markdown file containing:
1. A tree view of the repository structure (based on the configuration)
2. The contents of all included text files
3. Placeholders for binary files## License
[MIT License](LICENSE)