Auto Document Codebase Changes in LaTeX, Markdown, or Word
Project description
Adhoc: Auto-Documenting Codebase Changes
Adhoc is a command-line tool designed to automatically document changes in your codebase. By integrating with language models, it generates detailed explanations of code modifications and compiles them into professional documentation formats such as LaTeX, Markdown, or Word. This tool streamlines the documentation process, making it effortless for developers to maintain up-to-date records of their code evolution.
Table of Contents
Features
- Automatic Documentation: Generates explanations for code changes using a Language Learning Model (LLM).
- Multiple Output Formats: Supports documentation in LaTeX, Markdown, and Word formats.
- Version Control Integration: Detects code changes and commits through simple commands.
- Configurable Settings: Allows customization of output formats and author information via a configuration file.
- Extensible Design: Modular structure makes it easy to extend functionalities.
Installation
To install Adhoc, you can use pip:
pip install adhoc-python
Ensure you have the necessary dependencies listed in the requirements.txt file.
Usage
Adhoc provides a set of commands to initialize your project, commit changes, generate documentation, and configure settings. Below is an explanation of each command and how to use it.
Initialization
Before using Adhoc, you need to initialize your project:
adhoc init
What it does:
- Creates a
.Adhocdirectory in your project root to store configurations and databases. - Initializes a SQLite database to track code changes.
- Generates an initial codebase summary using an LLM, providing an overview of your existing code.
Committing Changes
After making changes to your codebase, use the following command to commit those changes and generate explanations:
adhoc commit -m "Your commit message"
Options:
-m, --message: (Optional) A commit message describing the changes.
What it does:
- Detects changes since the last commit by comparing snapshots.
- Generates explanations for the changes using the LLM, incorporating your commit message if provided.
- Stores the changes and explanations in the database for future reference.
Generating Documentation
To create documentation of your codebase and its changes, run:
adhoc generate
What it does:
- Retrieves the codebase summary and change explanations from the database.
- Generates a documentation file in the format specified in your configuration (latex, markdown, or word).
- The output file (
documentation.tex,documentation.md, ordocumentation.docx) is created in your project directory.
Configuration
Customize Adhoc settings using the adhoc config command:
adhoc config -d md -u "Your Name"
Options:
-d, --document-format: Sets the output document format. Acceptsmdfor Markdown,texfor LaTeX, orwordfor Word documents.-u, --username: Sets the author name to be used in the documentation.
What it does:
- Updates the configuration file (
config.jsonin the.Adhocdirectory) with your preferences. - The changes affect how documentation is generated and personalized.
Example:
adhoc config -d word -u "Shreyas"
- Sets the output format to Word.
- Sets the author name to "Shreyas".
Requirements
- Python 3.6 or higher
Dependencies:
jinja2requestswatchdogpython-docx(for Word document generation)
Additional dependencies are listed in requirements.txt.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License. See the LICENSE file for details.
A Reflective Note
"Life is an ad hoc affair. It has to be improvised all the time because of the hard fact that everything we do changes what is. This is distressing to people who would like to see things beautifully planned out and settled once and for all. That cannot be."
― Jane Jacobs
Happy coding!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file adhoc_python-1.0.0.tar.gz.
File metadata
- Download URL: adhoc_python-1.0.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bfb348849524e0bb08661c4e5aca2192aabfbe027a2a54f413d252fdf77f74b
|
|
| MD5 |
a19f7db4a2ef7161d7f69be3413bb4b5
|
|
| BLAKE2b-256 |
046c0c9b47d3247684ca64eadb401c9b312baf6aa15379b79b7ac9d9de1a63d1
|
File details
Details for the file adhoc_python-1.0.0-py3-none-any.whl.
File metadata
- Download URL: adhoc_python-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec9d75cdce39f5e35b24060ab0581ae6484cc656f32c33966c315c2d83b843da
|
|
| MD5 |
87e239b02ccdd7544aa71c4c82228841
|
|
| BLAKE2b-256 |
ae156326084d326acc53213be3f31b6fa8e930b66c209acd0d0142dfd5e8563f
|