Skip to main content

A tool to generate Markdown documentation from Git repositories

Project description

GitToMarkdown

A Python tool that automatically generates Markdown documentation from Git repositories. It creates comprehensive documentation including directory structure and file contents in a well-organized Markdown format.

Features

  • Clone and document Git repositories via HTTPS or SSH
  • Concurrent processing of multiple repositories
  • Generate directory tree structure in Markdown
  • Include file contents with syntax highlighting
  • Support for XML and JSON input files containing repository URLs
  • Progress bars for clone and documentation generation
  • Configurable thread count for parallel processing

Installation

pip install gittomarkdown==1.0.0

Usage

Basic Usage

from GitToMarkdown.GTM import GitToMark

# Document a single repository
repo = GitToMark("https://github.com/username/repository.git")
repo.generate

# Document multiple repositories
repos = GitToMark([
    "https://github.com/user1/repo1.git",
    "https://github.com/user2/repo2.git"
])
repos.generate

Using SSH

# Configure SSH key path first
GitToMark.config(ssh_path="/path/to/your/ssh/key")

# Clone and document using SSH
repo = GitToMark("git@github.com:username/repository.git", ssh=True)
repo.generate

Batch Processing from Files

# From XML file
repos = GitToMark.from_xml("repositories.xml")
repos.generate

# From JSON file
repos = GitToMark.from_json("repositories.json")
repos.generate

# From text file (one URL per line)
repos = GitToMark.from_file("repositories.txt")
repos.generate

Configuration

# Configure thread count and SSH key path
GitToMark.config(threads=8, ssh_path="/path/to/ssh/key")

Directory Structure

  • GitToMarkdown/: Main package directory
    • GTM.py: Core functionality
    • Generator.py: Markdown generation logic
    • MarkdownUtils.py: Markdown formatting utilities
    • Parsers.py: Input file parsers
    • ProgressBar.py: Progress bar implementation
    • Zipper.py: Repository compression utility
    • errors.py: Custom error definitions

Output

The generated documentation will be saved in the Output directory with the following format:

  • Repository tree structure
  • File contents with syntax highlighting based on file extension
  • Organized sections with clear headers

Requirements

  • Python 3.6+
  • GitPython
  • requests
  • tqdm
  • configparser

License

This project is under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gittomarkdown-1.0.6.tar.gz (8.8 kB view details)

Uploaded Source

File details

Details for the file gittomarkdown-1.0.6.tar.gz.

File metadata

  • Download URL: gittomarkdown-1.0.6.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gittomarkdown-1.0.6.tar.gz
Algorithm Hash digest
SHA256 e5072ea672f818e21fac197538b12a4dea4e60f4788e251f8e62deb56ec09c5d
MD5 c83fd54bc3165a39addd32afcb9831c9
BLAKE2b-256 08b3b0f607d9cb4b5a68ae35b9527da2a4f4635b820b6178b25429418c689400

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page