Skip to content

Latest commit

 

History

History
85 lines (60 loc) · 2.36 KB

File metadata and controls

85 lines (60 loc) · 2.36 KB

Auto Changelog Generator

A Python tool for automatically generating changelogs from Git commits using Jinja2 templates. Supports multiple output formats including Markdown, HTML, plain text, and JSON.

Features

  • Multiple Output Formats: Generate changelogs in Markdown, HTML, plain text, or JSON
  • Jinja2 Templating: Fully customizable templates for different output formats
  • Git Integration: Direct integration with Git repositories
  • Flexible Configuration: Command-line options for format selection and output customization
  • Beautiful HTML Output: Professional-looking HTML changelogs with CSS styling

Installation

  1. Clone the repository:
git clone <repository-url>
cd auto-changelog
  1. Install dependencies:
pip install -r requirements.txt

Usage

Basic Usage

python main.py <repository-url> <branch-name>

Advanced Usage

# Generate HTML changelog
python main.py https://github.com/Spring-0/face-censor main -f html -o changelog.html

# Generate JSON output
python main.py https://github.com/Spring-0/face-censor development -f json -o changelog.json

# Use custom template directory
python main.py https://github.com/Spring-0/face-censor main -t custom_templates -f markdown

Command Line Options

  • repo_url: URL of the Git repository
  • branch_name: Branch to generate changelog for
  • -o, --output: Output file path (default: stdout)
  • -f, --format: Output format (markdown, html, text, json)
  • -t, --template-dir: Custom template directory (default: templates)

Template Formats

Markdown

Clean, GitHub-compatible markdown format with commit details and metadata.

HTML

Professional HTML output with embedded CSS styling for web display.

Text

Plain text format suitable for terminal output or simple documentation.

JSON

Structured JSON output for programmatic processing and API integration.

Custom Templates

You can create custom Jinja2 templates by adding .j2 files to the templates directory. Templates have access to:

  • commits: List of commit objects with the following properties:
    • hex: Full commit hash
    • message: Commit message
    • author: Author name
    • date: ISO format date
    • date_formatted: Human-readable formatted date
  • generation_date: Timestamp when the changelog was generated

Requirements

  • Python 3.7+
  • GitPython
  • Jinja2